Math.asin method

The Math.asin method returns the arcsine (or inverse sine) of a number. The parameter must be between -1 and 1, otherwise NaN will be returned.

Syntax

javascriptMath.asin(number);

Example

Let's output the arcsine of the number 0.45.

javascriptconsole.log(Math.asin(0.45));

The code execution result:

javascript0.4667653390472964

Example

Let's output the arcsine of the number -1:

javascriptconsole.log(Math.asin(-1));

The code execution result:

javascript-1.5707963267948966

Example

Let's output the arcsine of the number 45. Since the parameter is greater than 1, NaN will be returned:

javascriptconsole.log(Math.asin(45));

The code execution result:

javascriptNaN

See also

  • the Math.cos method
    that returns the cosine of a number
  • the Math.sin method
    that returns the sine of a number
  • the Math.tan method
    that returns the tangent of a number
  • the Math.acos method
    that returns the arccosine of a number
  • the Math.atan method
    that returns the arctangent of a number