Construct unit pure quaternions orthogonal to elements of a pure quaternion array
U = orthogonal(V, W)
orthogonal(V, W) constructs and returns an array of unit pure quaternions each orthogonal to the corresponding element of V, and W if given. V and W must be pure quaternions, but need not have unit modulus. Elements of W need not be orthogonal to the corresponding elements of V, but they must not be parallel.
Either or both of V or W may be a scalar, in which case, it is treated as if the same size as the other.
The function works for the complex quaternion case as well as for real quaternions.
>> orthogonal(qi, qj) ans = 0 * I + 0 * J + 1 * K >> A = randv(3); >> B = orthogonal(A, quaternion(1,0,1)); >> scalar_product(A, B) ans = 1.0e-16 * 0 0.5551 -0.0694 0.0520 0 0 0 0.5551 -0.5551