tomrshl
12-07-2009, 09:07 PM
Using AS3: How do I find the opposite and adjacent sides of a triangle given the hypotenuse and one angle?
I tried this:
var hypotenuse:Number = 40;
var angle:Number = 8;
var opposite:Number = (hypotenuse*(Math.sin(angle)));
var adjacent:Number = (hypotenuse*(Math.cos(angle))); (these are just example values)
But I'm not sure if the numbers are correct, sometimes I get a negative number. To be honest, I haven't done maths for a while. I tried looking up the equations but I got confused. Could someone let me know if I'm doing it right?
Thanks
I tried this:
var hypotenuse:Number = 40;
var angle:Number = 8;
var opposite:Number = (hypotenuse*(Math.sin(angle)));
var adjacent:Number = (hypotenuse*(Math.cos(angle))); (these are just example values)
But I'm not sure if the numbers are correct, sometimes I get a negative number. To be honest, I haven't done maths for a while. I tried looking up the equations but I got confused. Could someone let me know if I'm doing it right?
Thanks