I know that sin is opposite/hypotenuse in a right angled triangle and cos is adjacent/hypotenuse. But when i come across functions like for Eg. In Flash :-
something.x = Math.cos(someNumber) * someotherNumber;
something.z = Math.sin(someNumber) * someotherNumber;
what does it actually do? My stack overflows when i see such things. I don’t understand trignometry that well. What is the opposite and what exactly is the hypotenuse in the above lines? And why does it use cos on one line and sin on other? Is there any shortcut for calculating these kind of things? Please help me. These things i didn’t understand even when i took computer graphics classes and unfortunately even when i asked to my lecturer, she always used to tell, these things you already studied when you were in 7th grade. But i really don’t remember that i studied anything like this.
Thanks in advance 🙂
I recommend you read the Wikipedia entry on the unit circle.
In short, if you are looking for the coordinates of a point located on a circle of radius 1 at a given counter-clockwise angle from the right-most point of the circle, its y coordinate will be given by the sine of this angle, and its x coordinate will be given by the cosine of this angle.
If your circle has a radius of something other than 1, you must multiply by that radius, hence the
*someotherNumberin your equations.