Maths & numbers

Quaternion vector rotation

Normalise a Hamilton quaternion and use it to rotate a 3D vector.

Quaternion vector rotation
Esc to restore

Your inputs

Results update as you type. Larger files run when you press Update result.

Your result

LOCAL & PRIVATE

Your result will appear here.

Your inputs stay in this browser. Nothing is uploaded or saved.

A clear answer. Here’s how.

Treats quaternion components in [w,x,y,z] Hamilton order and normalises the quaternion before applying active right-handed rotation q·[0,v]·conjugate(q). Zero quaternion is rejected. q and −q represent the same rotation. Reports the normalised quaternion and rotated coordinates; vector length is preserved within floating-point rounding. Component ordering and handedness may differ in other software.

See a worked example

Worked example

A fixed demonstration, separate from the values you enter above.

Vector X
1
Vector Y
0
Vector Z
0
Quaternion real component w
0.7071067811865476
Quaternion X component
0
Quaternion Y component
0
Quaternion Z component
0.7071067811865476

Example result

Rotated X
0.000000000000000222044604925
Rotated Y
1
Rotated Z
0
Normalised quaternion [w,x,y,z]
0.7071067811865475, 0, 0, 0.7071067811865475

Hamilton quaternion, normalised before active right-handed rotation q·[0,v]·conjugate(q). Zero quaternion is rejected.