scipy.linalg.
cosm#
- scipy.linalg.cosm(A)[source]#
计算矩阵余弦。
此例程使用 expm 计算矩阵指数。
- 参数:
- A(N, N) array_like
输入数组
- 返回值:
- cosm(N, N) ndarray
A 的矩阵余弦
示例
>>> import numpy as np >>> from scipy.linalg import expm, sinm, cosm
欧拉恒等式(exp(i*theta) = cos(theta) + i*sin(theta))应用于矩阵
>>> a = np.array([[1.0, 2.0], [-1.0, 3.0]]) >>> expm(1j*a) array([[ 0.42645930+1.89217551j, -2.13721484-0.97811252j], [ 1.06860742+0.48905626j, -1.71075555+0.91406299j]]) >>> cosm(a) + 1j*sinm(a) array([[ 0.42645930+1.89217551j, -2.13721484-0.97811252j], [ 1.06860742+0.48905626j, -1.71075555+0.91406299j]])