asin

Returns the arcsine (in radians) of a number.

Applies to

Math

Syntax

asin(x)

Parameters

x

A number.

Description

The asin method returns a numeric value between -pi/2 and pi/2 radians. If the value of number is outside this range, it returns 0.

asin is a static method of Math. As a result, you always use it as Math.asin(), rather than as a method of a Math object you create.

Examples

The following function returns the arcsine of the variable x:

function getAsin(x) {
      return Math.asin(x)
}

If you pass getAsin the value 1, it returns 1.570796326794897 (pi/2); if you pass it the value 2, it returns 0 because 2 is out of range.

See also

Math:acos, Math:atan, Math:atan2, Math:cos, Math:sin, Math:tan