Reputation: 3660
I have a value for sin:
var opposite = 100;
var hypotenuse = 228;
var sin = opposite/hypotenuse;
I want to know what angle that is. On my calculator I can just do sin^-1(). This thread says to use asin but when I use asin I get 45°. The correct angle is 25°.
Upvotes: 1
Views: 1172
Reputation: 29724
Because the arcus sinus returns result in radians and radian is defined as
you should convert result to degrees this way
var opposite = 100;
var hypotenuse = 228;
var sin = opposite/hypotenuse;
var angle = Math.asin(sin)*180/Math.PI;
document.body.innerHTML = angle;
example:
Upvotes: 1