m3sh.linalg.
rotation#
- rotation(u, v, axis)#
Rotation parameters.
Computes the values \(\cos(\varphi)\) and \(\sin(\varphi)\) of the rotation about axis that aligns the vectors u and v in the sense that u and v become parallel and point in the same direction, i.e.,
>>> v = mu * rotate(u, axis, *rotation(u, v, axis))
for some \(\mu > 0\). This assumes that u and v are orthogonal to axis. If this is not the case the vectors are first projected onto the plane perpendicular to axis.
- Parameters:
- u, vndarray, shape (3,)
Non-zero vectors in 3-space.
- axisndarray, shape (3,)
Unit length vector in 3-space not contained in the span of u and v.
- Returns:
- cos_phi, sin_phifloat
Cosine and sine of rotation angle.
See also