Python asin() Function

Python 数字Python Numbers


Description

asin()Returns the arc sine of x in radians.


Syntax

The syntax for the asin() method is:

import math

math.asin(x)

Note:asin() cannot be accessed directly; you need to import the math module, and then call the method through the math static object.


Parameters

  • x : A numeric value between -1 and 1. If x is greater than 1, an error will be generated.

Return Value

Returns the arc sine of x in radians.


Example

The following example demonstrates the use of the asin() method:

#!/usr/bin/python
import math

print "asin(0.64) : ",  math.asin(0.64)
print "asin(0) : ",  math.asin(0)
print "asin(-1) : ",  math.asin(-1)
print "asin(1) : ",  math.asin(1)

The output of the above example is:

asin(0.64) :  0.694498265627
asin(0) :  0.0
asin(-1) :  -1.57079632679
asin(1) :  1.57079632679

Python 数字Python Numbers

Other Extensions