.asin()

Anonymous contributor's avatar
Anonymous contributor
Published Sep 2, 2024
Contribute to Docs

Returns the arcsine of a value, giving an angle in radians between -π/2 and π/2 for inputs ranging from -1 to 1.

Syntax

To return the arcsine of an input value x ranging from -1 to 1 the following syntax is used.

math.asin(x)

Example 1

In the following example, the math.asin() function is used to return the arcsine of 1:

import math
print(math.asin(1))

The above code gives the following output measured in radians:

1.5707963267948966

Example 2

In the following code block, the math.asin() is used to return the arcsine of -0.5:

import math
print(math.asin(-0.5))

The above code gives the following output measured in radians:

-0.5235987755982989

Codebyte Example

Run the following example that uses the math.asin() inverse function to understand its working:

Code
Output
Loading...

All contributors

Contribute to Docs

Learn Python on Codecademy