This site requires JavaScript, please enable it in your browser!
Greenfoot back
Kartoffelbrot
Kartoffelbrot wrote ...

2013/5/20

Trigonometry

Kartoffelbrot Kartoffelbrot

2013/5/20

#
How I have to write arctan? Math.arctan(x) doesn't work.
GreenGoo GreenGoo

2013/5/20

#
Math.atan(x). You can check these things on the http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html - the official Java API.
Kartoffelbrot Kartoffelbrot

2013/5/20

#
Thank you!
GreenGoo GreenGoo

2013/5/20

#
Just out of interest, what are you using it for? I've only had to use it once when I was trying to make a more realistic missile homing system than using the turnTowards() method.
Kartoffelbrot Kartoffelbrot

2013/5/20

#
I am using it to calculate the rotation of an object out of the coordinates on the left up corner and the corner down right, so that it's turning from the first to the second coordinates. How can I calculate my value into radian?
GreenGoo GreenGoo

2013/5/20

#
Into radian? I'm fairly sure that the number starts off as a radian, because I had to use the Math.toDegrees() method in my scenario. To convert it, however, you can use the Math.toRadians() method.
Kartoffelbrot Kartoffelbrot

2013/5/20

#
Ok, thank you. I switched that properly.
Kartoffelbrot Kartoffelbrot

2013/5/20

#
Now it works fine. You were right. Thank you for that.
GreenGoo GreenGoo

2013/5/20

#
You're welcome.
Kartoffelbrot Kartoffelbrot

2013/5/20

#
How can I take the root?
nooby123 nooby123

2013/5/20

#
Use : Math.sqrt()
Kartoffelbrot Kartoffelbrot

2013/5/20

#
Thanks
You need to login to post a reply.