Expand description
Fitting rotations to data, following scipy.spatial: the rotation that best aligns two sets
of vectors (Rotation.align_vectors, the Kabsch or Wahba problem), the mean of rotations
(Rotation.mean), orthogonal Procrustes analysis (procrustes, orthogonal_procrustes),
and interpolation along great circles (geometric_slerp).
See the book entry Rotation fitting, Procrustes analysis and Hausdorff distance.
Structs§
- Alignment
- The result of
align_vectors. - Procrustes
Result - The result of
procrustes.
Functions§
- align_
vectors - The rotation
CminimisingΣ wᵢ ‖aᵢ − C bᵢ‖²(SciPy’sRotation.align_vectors; Wahba’s problem). WithB = Σ wᵢ aᵢ bᵢᵀ = U S Vᵀ, the answer isC = U diag(1, 1, det(UVᵀ)) Vᵀ(Kabsch’s algorithm); the determinant correction keeps it a rotation rather than a reflection. With a single pair, or one infinite weight, that pair (the primary) is aligned exactly by the smallest rotation, and the remaining freedom — a rotation about the primary — best aligns the others. - geometric_
slerp - Points along the great circle from
starttoendon the unit sphere in any dimension, at the fractionstof the way (SciPy’sgeometric_slerp):(sin((1 − t)ω) start + sin(tω) end) / sin ω,ωthe angle between them. Both must be unit vectors; antipodal points have no unique great circle and are an error, and equal points give that point. - orthogonal_
procrustes - The orthogonal matrix
Rminimising‖A R − B‖_Fand the scaleΣ σᵢ(SciPy’sorthogonal_procrustes): withAᵀB = U S Vᵀ,R = U Vᵀ.AandBarem × d(rows are points); reflections are allowed. - procrustes
- Procrustes analysis of two configurations of
mpoints inddimensions (SciPy’sscipy.spatial.procrustes): both are centred and scaled to unit norm, then the second is rotated (reflections allowed) and scaled to best match the first; the disparity is the remaining sum of squared differences, a measure of difference in shape. - rotation_
mean - The mean of rotations (SciPy’s
Rotation.mean): the unit quaternion maximisingΣ wᵢ (q · qᵢ)², the eigenvector of the largest eigenvalue ofΣ wᵢ qᵢ qᵢᵀ(Markley et al.). It minimises the weighted sum of squared chordal distances‖R − Rᵢ‖², and is unaffected by the sign ambiguityq ~ −q.