Want to understand the math behind "OpenGL" quaternion, rotation axis and rotation angle.

136 Views Asked by At

I want to understand the math behind OpenGL quaternion, rotation axis and rotation angle. There are a LOT of functions in programs that do this for you, however, they don't exactly explain the math. And that's no fun!

So to my example problem:

Vector

$$Apoint-x_1=109973,18\;y1=1156562\;z1=50,449$$
$$Bpoint - x_2=109924,1\; y2=1156621,9 \;z2=48,569$$

$$V= 49,082 \;−59,955 \;1,88$$

Magnitude vector $V$

$$||V||= 77,505994$$

Normalized vector $V$ $$U=0,6332671 \;−0,773553\; 0,0242562$$

How do I calculate the rotation angle and rotation axle between these two points and then use it to calculate the quaternion?