quaternionic.alignment

align

align(a, b, w=None)

Source: quaternionic/alignment.py

Find the rotation aligning vectors a to b This function solves Wahba's problem, essentially computing a quaternion corresponding to the rotation ℛ that minimizes the loss function L(ℛ) ≔ Σᵢ wᵢ ‖a⃗ᵢ - ℛ b⃗ᵢ‖² Note that currently this function is only designed to work with 3-vectors, and will raise an error if the input arrays a and b are not of shape (N, 3). The optional w parameter, if present, should be of shape (N,); otherwise all weights are assumed to be 1.