Few trig questions. (How to calculate cos/sin/tan manually etc)

Can someone write down the formulas that flash MX uses when you use the functions tan/sin/cos…
I am trying to get a good grasp on these things and it would really help me a lot if someone could help :slight_smile:

Math.tan
Math.sin
Math.cos

in a right triangle:

sin (non-90 angle) = opp. side length / hypot.
cos ("") = adj. side length / hypot.
tan("") = opp. side length / adj. side length

Haha trigonometry is one of my favorite topics in math! Best advice is to listen to your teacher in math! J/k :beam: Probably the easiest subject in my whole student life! lol

in a triangle, a b and c being the sides (length) of the triangle and A B and C the angles opposed to side a b and c, you have:

a²=b²+c² - 2bc * cos A

Harhar - I’ve got plenty of **** like that this year too…

http://www.ping.be/~ping1339/gonio.htm

basically trig is used for calculating coordinates and angles and everything

So, if I have the X and Y of a point of a right triangle, how would I calculate where the radius is and/or the angle or the hypotenuse?
I found somewhere on the net that to calculate the angle you do:
Adjacent side length/Hypotenuse side length

To calculate the hypotenuse’ length you add together Adjacent squared and Opposite squared, and find the square root of those and you have the length of the hypotenuse…
Sorry, I have yet to take trigonometry in school, thank you for the input :slight_smile:

Let me put it this way:
What is the formula behind Math.atan2 ??? Thanks

Math.atan2 = function(y,x){
	if (x == 0){
		if (y < 0) return -Math.PI/2;
		else if (y > 0) return Math.PI/2;
		else return 0;
	}else if (x<0){
		if (y<0) return Math.atan(y/x) - Math.PI;
		else return Math.atan(y/x) + Math.PI;
	}else return Math.atan(y/x);
};

How about atan too(or the place where you got the info :wink: )? Thank you very much!!

did you read the rotating a vector post yet? that might help
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=12181

Yes, I was just wondering what goes on behind the sine etc functions…

http://mathworld.wolfram.com/Trigonometry.html

Thanks :slight_smile: