bundles / scipy latest / scipy / linalg / _matfuncs / tanm
function
scipy.linalg._matfuncs:tanm
source: build-install/usr/lib/python3.14/site-packages/scipy/linalg/_matfuncs.py:519
Signature
def tanm(A)Summary
Compute the matrix tangent.
Extended Summary
This routine uses expm to compute the matrix exponentials.
The documentation is written assuming array arguments are of specified "core" shapes. However, array argument(s) of this function may have additional "batch" dimensions prepended to the core shape. In this case, the array is treated as a batch of lower-dimensional slices; see linalg_batch for details. The NEP 5 signature of this function is (i,i)->(i,i).
Parameters
A: (N, N) array_likeInput array.
Returns
tanm: (N, N) ndarrayMatrix tangent of
A
Examples
import numpy as np from scipy.linalg import tanm, sinm, cosm a = np.array([[1.0, 3.0], [1.0, 4.0]]) t = tanm(a)✓
t
✗array([[ -2.009, -8.419],
[ -2.806, -10.428]])
Verify tanm(a) = sinm(a).dot(inv(cosm(a)))
s = sinm(a) c = cosm(a)✓
s.dot(np.linalg.inv(c))
✗array([[ -2.009, -8.419],
[ -2.806, -10.428]])
Aliases
scipy.linalg.tanm