Hàm numpy.arccosh() tính hyperbolic cosine nghịch (inverse hyperbolic cosine). Với đầu vào thực, trả về thực cho x >= 1, ngược lại trả về nan. Với số phức, hàm giải tích với branch cut [-inf, 1]. Quy ước: phần ảo trong [-pi, pi], phần thực trong [0, inf].
Tham số
- x (array_like): Mảng đầu vào.
- out (ndarray, tùy chọn): Vị trí lưu kết quả.
- where (array_like, tùy chọn): Điều kiện broadcast.
Các bước thực hiện
Nhập NumPy, tính các giá trị:
import numpy as np
print("Tính hyperbolic cosine nghịch...")
print("\nKết quả...", np.arccosh(np.pi*1j))
print("\nKết quả...", np.arccosh(np.pi/2.)) # 90 độ
print("\nKết quả...", np.arccosh(np.pi/3.)) # 60 độ
print("\nKết quả...", np.arccosh(np.e)) # e
Ví dụ hoàn chỉnh
import numpy as np
print("Tính hyperbolic cosine nghịch...")
print("\nKết quả...", np.arccosh(np.pi*1j))
print("\nKết quả...", np.arccosh(np.pi/2.))
print("\nKết quả...", np.arccosh(np.pi/3.))
print("\nKết quả...", np.arccosh(np.e))
Kết quả đầu ra
Tính hyperbolic cosine nghịch...
Kết quả... (1.8622957433108482+1.5707963267948966j)
Kết quả... 1.0232274785475506
Kết quả... 0.30604210861326536
Kết quả... 1.6574544541530771