The asin() method returns the arcsine of a number as a value between -PI/2 and PI/2 radians.
The asin() method returns the arcsine of a number as a value between -PI/2 and PI/2 radians.
If the parameter x is outside the range -1 to 1, the browser will return NaN.
1 for the value of PI/2.
-1 for the value of -PI/2.
Math.asin(x)
Parameter | Require | Description |
---|---|---|
x | Required. | A number |
A Number, from -PI/2 to PI/2, or NaN if the value is outside the range of -1 to 1
Return the arcsine of a number:
//display the arcsine of 0.5 console.log(Math.asin(0.5));//w ww . ja va 2s . co m console.log(Math.asin(0)); console.log(Math.asin(1));