JavaScript Math.asin()
Definition and Usage
The Math.asin() method returns the arcsine of a number as a value between -PI/2 and PI/2 radians.
Note: If the parameter x is outside the range -1 to 1, the browser will return NaN.
Tip: 1 will return the value of PI/2. -1 will return the value of -PI/2.
Browser Support
Math.asin()
is an ECMAScript1 (ES1) feature.
ES1 (JavaScript 1997) is fully supported in all browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |
Syntax
Math.asin(x)
Parameter Values
Parameter | Description |
---|---|
x | Required. A number |
Return Value
A number from -PI/2 to PI/2. NaN if the value is outside the range of -1 to 1. |