数学模块包含许多用于数学运算的函数。 math.asinh()函数返回数字的双曲反正弦值。
用法: math.asinh(x)
参数:此方法仅接受单个参数。
- x:此参数是要传递给asinh()的值
返回值:此函数返回数字的双曲反正弦值。
以下示例说明了上述函数的用法:
范例1:
# Python code to implement
# the asinh()function
# importing "math"
# for mathematical operations
import math
# Return the hyperbolic arc sine value of numbers
print (math.asinh(17))
print (math.asinh(5.6))
print (math.asinh(245))
print (math.asinh(-3445))
输出:
3.5272244561999657 2.4237920435875173 6.194409556009931 -8.837826385072708
范例2:
# Python code to implement
# the aasinh()function
import math
import matplotlib.pyplot as plt
in_array = [-0.14159265, -0.57039399, -0.28559933,
0.28559933, 0.57039399, 0.94159265]
out_array = []
for i in range(len(in_array)):
out_array.append(math.asinh(in_array[i]))
i += 1
print("Input_Array:\n", in_array)
print("\nOutput_Array:\n", out_array)
plt.plot(in_array, out_array, "go:")
plt.title("math.asinh()")
plt.xlabel("X")
plt.ylabel("Y")
plt.show()
输出:
Input_Array: [-0.14159265, -0.57039399, -0.28559933, 0.28559933, 0.57039399, 0.94159265] Output_Array: [-0.14112374861052449, -0.5432727660031201, -0.28185270483975433, 0.28185270483975433, 0.5432727660031201, 0.8394645626112472]
相关用法
- Python Wand function()用法及代码示例
- Python map()用法及代码示例
- Python dir()用法及代码示例
- Python int()用法及代码示例
- Python id()用法及代码示例
- Python hex()用法及代码示例
- Python now()用法及代码示例
- Python oct()用法及代码示例
- Python str()用法及代码示例
- Python cmp()用法及代码示例
- Python sum()用法及代码示例
- Python ord()用法及代码示例
- Python tell()用法及代码示例
- Python type()用法及代码示例
- Python format()用法及代码示例
- Python locals()用法及代码示例
- Python numpy.ix_()用法及代码示例
注:本文由纯净天空筛选整理自SHUBHAMSINGH10大神的英文原创作品 Python – math.asinh() function。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。