Skip to main content
c.pfaffenbichler
Community Expert
Community Expert
January 17, 2009
Question

how to get sin-1/arc sine in javascript

  • January 17, 2009
  • 5 replies
  • 4791 views
This time I ask doubly humbled because not only am I weak in JavaScript but Ive come to realize that Ive gotten pretty bad at mathematics  
On my calculator the key »sin-1« (sinus to the power of negative one) gets me the angle in degrees if I enter the value I get by dividing the opposite side by the hypothenuse (of a right triangle naturally), but I cant figure out how to achieve that in JavaScript.
The calculator-key signifies the arc sine, which the function Math.asin() should also provide but I dont seem to get meaningful results, instead the result looks like what on my calculator is called the hyperbolic sine.
Could someone please help me out here Script- and/or math-wise?
This topic has been closed for replies.

5 replies

c.pfaffenbichler
Community Expert
Community Expert
January 18, 2009
Thanks!
Youve helped me a lot!

Have a great weekend
Pfaffenbichler
Inspiring
January 17, 2009
var x = 0.235
Math.asin( x )*(180/Math.PI)
try67
Community Expert
Community Expert
January 17, 2009
The result is in radians. 0.2372 radians is 13.6 degrees.
To convert from radians to degrees you need to multiply by 180/π (which is about 57.2958).
c.pfaffenbichler
Community Expert
Community Expert
January 17, 2009
Thanks for the reply, but that doesnt help me.
I need the angle (for example for 0.235 I would like the reply of 13.6) and
Math.asin(0.235);
gets me the result »0.23721856«.
Do I make some mistake or do I have to process that result further? If so, how?
Like I said, my math-skills have seriously deteriorated, but its just a keystroke on the calculator

Edit: Could the calculator-people use the term arc sine based on another definition?
try67
Community Expert
Community Expert
January 17, 2009
Math.asin(x) will solve your problem.

For more info about JS's Math Object, look here:
http://w3schools.com/jsref/jsref_obj_math.asp