NumPy offers the ufuncs sinh(), cosh(), and tanh() that accept values in radians and return the corresponding hyperbolic sine, cosine, and tangent values.
Calculate the sinh value of π/2.
| import numpy as np x = np.sinh(np.pi/2) print(x) |
Calculate the cosh values for all elements in the array arr.
| import numpy as np arr = np.array([np.pi/2, np.pi/3, np.pi/4, np.pi/5]) x = np.cosh(arr) print(x) |
Finding angles from hyperbolic sine, cosine, and tangent values involves using inverse functions like arcsinh, arccosh, and arctanh. NumPy provides the ufuncs arcsinh(), arccosh(), and arctanh() to return angle values in radians for the corresponding sinh, cosh, and tanh values.
Determine the angle corresponding to a value of 1.0.
| import numpy as np x = np.arcsinh(1.0) print(x) |
Calculate the angle for all tanh values in the array.
| import numpy as np arr = np.array([0.1, 0.2, 0.5]) x = np.arctanh(arr) print(x) |