Hello, ive been trying make a game, and i need the degree of an angle to do this. To cut to the chase, i have a right angle triangle. I know all three lengths of the sides, but how do i figure out one of the angles? I tried searching on the net but all the methods use sin-1, and in flash all it has is sin. \r\rDoes anyone have any advice on how to solve this?\rThanks-\r\r(And how do u get the flash files down the bottom of the screen?)
A right angle triangle is a triangle which has an 90° angle, right ??\r\rpom 0]
well, if it is a right triangle, you could find the other two angles if you know the length of one of the other sides. take a look in your local geometry book. or any math book.
i don’t know what flash you’re talking about that only has cosine. my flash has all kinds of fun with math.\rto find out the angle between any two points:\r\rnXdiff = mcPoint2._x-mcPoint1._x;\rnYdiff = mcPoint2._y-mcPoint1._y;\rnAngle = ((Math.atan2(nYdiff, nXdiff))/Math.PI*180)+90;\r\rthat will tell you the angle that a ray from the center of mcPoint1 would have to be in order to intersect with the center of mcPoint2.\rto use this to find out the angles of a right triangle:\rfind the angle between the two points that are NOT part of the right angle, then subtract that angle plus 90 from 180.\rAND go clockwise please.\r:) \rjeremy
the sin-1 equivelant in flash is Math.asin(). the rest is trig.
If you know all the length, you can use whichever inverse function you want acos, asin or atan :
The triangle looks like that :\r\r a\r\r ----\r\r ! /\r\rb ! / c\r\r !/
If A is the right angle, B is the angle on the right, and C is the lowest angle, you have
cos(C)=b/c hence C=Math.acos(b/c) ;\r\rB=Math.acos(a/c) ;
. I hope this makes sense.\r\rpom 0]
Thanks for the help,\r\rive tried it out and i got the right angle!