Hi,
Can someone help me refresh my trigonometry on calculating an angle?
I am using the general formula [see below] but I do not get the expected angles for known values.
myAngle = 180*Math.atan2(x,y)/Math.PI;
for x=0 or y=0 or x=y results are as expected 0,90,45.
but for x=2y or y=2x, where we know angles are 60 or 30 degrees the result are off [63.43 annd 26.56 respectevely].
Can someone explain why and what should I do to get the correct result?
Thank you.
Can someone help me refresh my trigonometry on calculating an angle?
I am using the general formula [see below] but I do not get the expected angles for known values.
myAngle = 180*Math.atan2(x,y)/Math.PI;
for x=0 or y=0 or x=y results are as expected 0,90,45.
but for x=2y or y=2x, where we know angles are 60 or 30 degrees the result are off [63.43 annd 26.56 respectevely].
Can someone explain why and what should I do to get the correct result?
Thank you.
Comment