A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/javascript/javascript-math-asin-method/ below:

JavaScript Math asin() Method - GeeksforGeeks

JavaScript Math asin() Method

Last Updated : 12 Jul, 2024

The Math.asin( ) method is used to return the arcsine of a number in radians. The Math.asin() method returns a numeric value between -pi/2 and pi/2 radians. The asin() is a static method of Math, therefore, it is always used as Math.asin(), rather than as a method of a Math object created.

Math.asin(x)=arcsin(x)=unique y where y belongs to [-pi/2;pi/2] such that sin(y)=x

Syntax:

Math.asin(value)

Parameters: This method accepts a single parameter as mentioned above and described below:

Returns: The Math.asin() method returns the arcsine of the given number in radians. 

Below is an example of the Math asin( ) Method.

Example 1: In this example, we will return the asin of 1 using the Math asin( ) Method.

JavaScript
console.log("When 1 is passed as a parameter: "
            + Math.asin(1));

Output:

When 1 is  passed as a parameter: 1.5707963267948966

Example 2: When -1 is passed as a parameter.

JavaScript
console.log("When -1 is passed as a parameter: "
            + Math.asin(-1));

Output:

When -1 is  passed as a parameter: -1.5707963267948966

Example 3: When 2 is passed as a parameter.

JavaScript
console.log("When 2 is passed as a parameter: "
            + Math.asin(2));

Output:

When 2 is  passed as a parameter: NaN

Example 4: When 0.5 is passed as a parameter.

JavaScript
console.log("When 0.5 is passed as a parameter: "
            + Math.asin(0.5));

Output:

When 0.5 is  passed as a parameter: 0.5235987755982989

We have a complete list of Javascript Math Objects methods, to check those please go through this Javascript Math Object Complete reference article.

Supported Browsers:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4