scipy.spatial.transform.Rotation.magnitude

Rotation.magnitude()

获取旋转的幅度。

退货
magnitudendarray或浮动

角度(以弧度为单位),如果对象包含单个旋转,则为浮点;如果对象包含多个旋转,则为ndarray。

示例

>>> from scipy.spatial.transform import Rotation as R
>>> r = R.from_quat(np.eye(4))
>>> r.magnitude()
array([3.14159265, 3.14159265, 3.14159265, 0.        ])

单次旋转的大小:

>>> r[0].magnitude()
3.141592653589793