0
\$\begingroup\$

Given three 3D unit vectors \$a\$, \$b\$, \$c\$ such that:

\$a \times b = c\$

\$b \times c = a\$

\$c \times a = b\$

(ie \$a, b, c\$ form an orthonormal basis)

How do we calculate a unit quarternion \$q\$ such that the sandwidch product (ie rotation) of \$q\$ on (1,0,0) is \$a\$, (0,1,0) is \$b\$ and (0,0,1) is \$c\$ ?

\$\endgroup\$
  • \$\begingroup\$ This operation (usually using only vectors a & b, since as you point out these two fully specify c already) is often called "LookRotation" and you can find implementations of it with a quick search. Have you had any specific difficulty putting the examples you've found into practice? \$\endgroup\$ – DMGregory Feb 6 at 12:48
0
\$\begingroup\$

An orthonormal basis forms a rotation matrix trivially by combining the three vectors and transposing (recall for an orthonormal matrix the inverse is just the transpose). The resulting rotation matrix can then be converted into a quarternion in the usual fashion.

|improve this answer|||||
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.