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