PDA

View Full Version : Few trig questions. (How to calculate cos/sin/tan manually etc)



babywax
August 30th, 2003, 06:02 AM
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 :)

senocular
August 30th, 2003, 07:11 AM
Math.tan
Math.sin
Math.cos

jingman
August 30th, 2003, 11:15 AM
in a right triangle:

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

comicGeek
August 30th, 2003, 11:34 AM
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

mlk
August 30th, 2003, 11:45 AM
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/%7Eping1339/gonio.htm

basically trig is used for calculating coordinates and angles and everything

babywax
August 30th, 2003, 06:30 PM
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 :)

babywax
August 30th, 2003, 07:52 PM
Let me put it this way:
What is the formula behind Math.atan2 ??? Thanks

senocular
August 30th, 2003, 09:56 PM
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);
};

babywax
August 30th, 2003, 11:22 PM
How about atan too(or the place where you got the info ;) )? Thank you very much!!

senocular
August 30th, 2003, 11:38 PM
did you read the rotating a vector post yet? that might help
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=12181

babywax
August 31st, 2003, 12:48 AM
Yes, I was just wondering what goes on behind the sine etc functions...

senocular
August 31st, 2003, 05:55 AM
http://mathworld.wolfram.com/Trigonometry.html

babywax
August 31st, 2003, 07:10 PM
Thanks :)