# Math.asin()

## 概述

Math.asin() 方法返回一个数值的反正弦（单位为弧度），即：

$∀x∊[-1;1],Math.asin(x)=arcsin(x)= the unique y∊[-π2;π2]such thatsin(y)=x\forall x \in [{-1};1],\;\mathtt{\operatorname{Math.asin}(x)} = \arcsin(x) = \text{ the unique } \; y \in \left[-\frac{\pi}{2}; \frac{\pi}{2}\right] \, \text{such that} \; \sin(y) = x$

## 语法

Math.asin(x)

### 参数

x

## 描述

asin 方法接受 -1 到 1 之间的数值作为参数，返回一个介于 $-\frac\left\{\pi\right\}\left\{2\right\}$ 到 $\frac\left\{\pi\right\}\left\{2\right\}$ 弧度的数值。如果接受的参数值超出范围，则返回 NaN

## 示例

### 例子：使用 Math.asin()

Math.asin(-2);  // NaN
Math.asin(-1);  // -1.5707963267948966 (-pi/2)
Math.asin(0);   // 0
Math.asin(0.5); // 0.5235987755982989
Math.asin(1);   // 1.570796326794897 (pi/2)
Math.asin(2);   // NaN

## 规范

ECMAScript 1st Edition. Implemented in JavaScript 1.0 Standard Initial definition.
ECMAScript 5.1 (ECMA-262)
Math.asin
Standard
ECMAScript 2015 (6th Edition, ECMA-262)
Math.asin
Standard

## 浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) (Yes) (Yes) (Yes) (Yes)
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)