1

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°.

Community
  • 1
  • 1
user1873073
  • 3,580
  • 5
  • 46
  • 81

1 Answers1

1

Because the arcus sinus returns result in radians and radian is defined as

enter image description here

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:

http://jsfiddle.net/o69xjayh/

4pie0
  • 29,204
  • 9
  • 82
  • 118