asin() Method in Python
sine
The inverse of a function is called arcsine
. Sine is equal to the ratio of the side opposite the hypotenuse to the longest side.
sine
The inverse of the function calculates the angle between the two sides. Assuming we have an 角度θ
, then θ
the formula 正弦
for 反正弦
the sum of will follow.
Sine Function -> sin(θ) = (Side opposit to θ angle) / (Hypotenuse)
Arcsine Function -> θ = sin⁻¹((Side opposit to θ angle) / (Hypotenuse))
Python programming language has a built-in module math
which is a part of the standard Python library.
This module has one method, asin()
, which is used to perform 反正弦
the operation.
asin()
In this article, you will learn how to calculate the arc sine or the reciprocal of the sine
in Python using the method.
asin()
Using the method
in Python
asin()
Method accepts a single floating point value which should be [-1, 1]
in the range , inclusive.
asin()
Method will calculate the angle in radians of the supplied floating point value.
To convert radians to degrees, use 1
radians equals 57.296
degrees. Alternatively, multiply the radian value by 180 / π
to convert it to degrees.
1 radian = 57.296 degrees
1 radian * 180 / π = 57.296 degrees
Let's understand asin()
the usage of method with the help of some relevant examples. See the following Python code.
import math
print(math.asin(0))
print(math.asin(1)) # π / 2
print(math.asin(-1)) # -π / 2
print(math.asin(10 / 20))
print(math.asin(40 / 50))
print(math.asin(-10 / 20))
print(math.asin(-40 / 50))
Output:
0.0
1.5707963267948966
-1.5707963267948966
0.5235987755982989
0.9272952180016123
-0.5235987755982989
-0.9272952180016123
For reprinting, please send an email to 1244347461@qq.com for approval. After obtaining the author's consent, kindly include the source as a link.
Related Articles
Enumerating a dictionary in Python
Publish Date:2025/05/05 Views:98 Category:Python
-
The function in Python enumerate() returns an object of enumeration type and adds a counter variable to iterate over a list or other type of collection. It makes looping over such objects easier. When we pass an enumeration object to list()
Changing dictionary values in Python
Publish Date:2025/05/05 Views:108 Category:Python
-
This tutorial will discuss various ways to change the value of a particular key in Python dictionary. We can do this by using the following methods. dict.update() method for cycle. Dictionary Unpacking dict.update() How to change dictionary
Finding the maximum value in a Python dictionary
Publish Date:2025/05/05 Views:60 Category:Python
-
This tutorial explains how to get a key with the maximum value in Python. Since the method has changed from the previous Python versions, it also lists some sample codes to clarify the concepts. Use operator.itemgetter() the method to get t
How to read input from stdin in Python
Publish Date:2025/05/05 Views:124 Category:Python
-
This tutorial discussed stdin the methods of reading input from in Python. You can read directly from the console or from a file name specified in the console. In Python, fileinput.input() use stdin fileinput We can use the read module in P
Maximum integer in Python
Publish Date:2025/05/05 Views:55 Category:Python
-
This tutorial will discuss the maximum integer value in different versions of Python and how we can get it. In Python 2, integers and long integers are different data types. The maximum value of an integer is 2 31 -1. If the value exceeds t
Get a list of time zones using Python
Publish Date:2025/05/05 Views:107 Category:Python
-
When developing real-world applications, software developers must ensure that the application can support users from both their own country and other parts of the world. Since most countries have different time zones and many people around
Convert NumPy array to list in Python
Publish Date:2025/05/05 Views:101 Category:Python
-
Lists and arrays are the two most basic and commonly used collection objects in Python. They are both mutable and are used to store a collection of elements under a common name and each element has a specific location that can be used to ac
Appending 2D Arrays in Python
Publish Date:2025/05/05 Views:64 Category:Python
-
In Python, we can have ND arrays. We can use NumPy module to process arrays in Python. This tutorial demonstrated the different methods you can use to append values to a two-dimensional array in Python. Use append() the function to ap
Sliding average of NumPy arrays in Python
Publish Date:2025/05/05 Views:190 Category:Python
-
The sliding average is often used to study time series data by calculating the average of data at a specific time interval. It is used to eliminate some short-term fluctuations and study data trends. When studying stock price trends, the si