Construct orthonormal basis
B = orthonormal_basis(V, W)
Creates an orthonormal basis from a pure quaternion V, and an optional pure quaternion W, which need not be perpendicular to V, but must not be parallel.
The result is represented as a 3×3 orthogonal matrix, which may be complex if V and/or W are complex pure quaternions.
>> orthonormal_basis(qi + qj, qk + qi) ans = 0.7071 0.7071 0 0.5774 -0.5774 -0.5774 -0.4082 0.4082 -0.8165 >> ans * ans' ans = 1.0000 0.0000 -0.0000 0.0000 1.0000 -0.0000 -0.0000 -0.0000 1.0000