On my calculator I typed in 90-sin^-1(Y/X)
Y=6, X=9
I was returned with approximately:
48.71 degrees (which I expected)
But on java it returns:
0.72
I was told to use asin on java... Is that correct?
On my calculator I typed in 90-sin^-1(Y/X)
Y=6, X=9
I was returned with approximately:
48.71 degrees (which I expected)
But on java it returns:
0.72
I was told to use asin on java... Is that correct?
trigonometric functions in programming languages return a value measured in radians. you need to convert to degrees like below.
degrees=radians*180/PI
Yes, the asin
method is correct for that.
The result from asin
is in radians, so you need to convert it to degrees:
double angle = 90 - Math.toDegrees(Math.asin(Y / X));