# Math.asin()

The Math.asin() function returns the arcsine (in radians) of a number, that is

$∀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$

## Syntax

JavaScript
Math.asin(<var>x</var>)

### Parameters

x
A number.

### Return value

The arcsine (in radians) of the given number if it's between -1 and 1; otherwise, NaN.

## Description

The Math.asin() method returns a numeric value between $-\frac\left\{\pi\right\}\left\{2\right\}$ and $\frac\left\{\pi\right\}\left\{2\right\}$ radians for x between -1 and 1. If the value of x is outside this range, it returns NaN.

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

## Examples

### Using Math.asin()

JavaScript
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.5707963267948966 (pi/2)
Math.asin(2);   // NaN

For values less than -1 or greater than 1, Math.asin() returns NaN.

## Specifications

Specification Status Comment
ECMAScript 1st Edition (ECMA-262) Standard Initial definition. Implemented in JavaScript 1.0.
ECMAScript 5.1 (ECMA-262)
The definition of 'Math.asin' in that specification.
Standard
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'Math.asin' in that specification.
Standard
ECMAScript 2017 Draft (ECMA-262)
The definition of 'Math.asin' in that specification.
Draft

## Browser compatibility

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)
{"ft_lang_label":"__label__en","ft_lang_prob":0.5156007,"math_prob":0.9905133,"size":1821,"snap":"2022-40-2023-06","text_gpt3_token_len":548,"char_repetition_ratio":0.15685195,"word_repetition_ratio":0.09166667,"special_character_ratio":0.30532673,"punctuation_ratio":0.15384616,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99874,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-09-29T01:08:34Z\",\"WARC-Record-ID\":\"<urn:uuid:319d25d5-e6c5-4f32-bb3a-5f11a6c3eecd>\",\"Content-Length\":\"19297\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:c037df06-f7a5-45e6-b255-b1828d625019>\",\"WARC-Concurrent-To\":\"<urn:uuid:13e39dfe-77c2-4409-9705-acb5785158dd>\",\"WARC-IP-Address\":\"69.172.237.208\",\"WARC-Target-URI\":\"https://reference.codeproject.com/javascript/reference/global_objects/math/asin\",\"WARC-Payload-Digest\":\"sha1:SVN6HB2HLHACGYMUBAO4ZKFJS46GRHSZ\",\"WARC-Block-Digest\":\"sha1:AB6UQW5ELOL4BPZR5AO2N6S7YOHYDOJG\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-40/CC-MAIN-2022-40_segments_1664030335303.67_warc_CC-MAIN-20220929003121-20220929033121-00138.warc.gz\"}"}