# Finding rotation quaternion from orthonormal basis?

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\$$ ?

• 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? – DMGregory Feb 6 at 12:48