-
Studying angles of a traingle
I’ve built a triangle in AE. Each leg’s height scale is equal to it’s length. By adjusting the height scale of either leg (a and b) the hypotenuse line (c)is then calculated and adjusted.
--------------
B
|\
| \c
|a \
|___\A
C b
--------------The code works but the formula didn’t work as I expected.
I’m solving for A (the anchor point of the hypotenuse)
a=thisComp.layer("leg2").transform.scale[1]; 'a is opposite
b=thisComp.layer("leg1").transform.scale[1]; 'b is adjacent
c=transform.scale[1]; 'c is the hypotenuse
ang=Math.asin(b/c);
angfin=radiansToDegrees(ang);
[-angfin]I used ‘asin’ but the formula was ‘b/c’ = adjacent/hypotenuse = cos.
Am I correct in that it should be Math.acos? Why does acos fail?