Mozilla.com

Summary

Returns the arcsine (in radians) of a number.

Method of Math

Static

Implemented in: JavaScript 1.0, NES 2.0
ECMA Version: ECMA-262

Syntax

Math.asin(x)

Parameters

x 
A number.

Description

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

asin is a static method of Math, so you always use it as Math.asin(), rather than as a method of a Math object you created.

Examples

Example: Using Math.asin

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 NaN because 2 is out of range.

See Also

acos, atan, atan2, cos, sin, tan

Page last modified 07:01, 15 Sep 2007 by Mgjbot

Tags:

Files (0)