Follow your curiosity

What discovery has been shared with you?

Start with one fact. Explore it, go deeper, then follow whichever branch catches your imagination.

Choose subjects for a surprise

Exploring any topic

Begin your discovery

Your next discovery is one click away.

Choose one or more subjects above, or leave Any Topic selected and let curiosity decide.

Mathematics

Quaternions: A Number System for Three-Dimensional Rotations

Quick fact

Quaternions were invented by William Rowan Hamilton in 1843, who was so excited he carved the fundamental formula into a bridge in Dublin. They are still used today in virtually every 3D graphics engine, including those in VR and robotics.

Why this is interesting

You've probably rotated objects in 3D games or used a phone's orientation sensor, but did you know that the math behind it often relies on a four-dimensional number system discovered in the 19th century? These numbers, called quaternions, are the secret hero of smooth 3D rotations.

Read the full explanation

Understanding Quaternions: A Number System for Three-Dimensional Rotations

Imagine you want to rotate a point in 3D space. The most common method might be to use three angles (pitch, yaw, roll), but this suffers from a problem called gimbal lock, where axes become parallel and you lose a degree of freedom. Quaternions offer a better way. Think of a quaternion as a package that contains both an axis of rotation and the amount of rotation around that axis. A quaternion is written as q = w + xi + yj + zk, where w is a scalar part (like a complex number's real part) and (x, y, z) are the three components of a vector part. The i, j, k are imaginary units with special rules. To rotate a point, you express the point as a pure quaternion (where w=0), then you multiply: q point q⁻¹, where q is a unit quaternion representing the rotation. This operation effectively spins the point around the axis by the angle. Because quaternions are four-dimensional, they don't suffer from gimbal lock, and they perform rotations with extra numerical stability.

A deeper explanation

The magic of quaternions lies in their multiplication rules. For i, j, k, we have i² = j² = k² = ijk = -1, and they are non-commutative: ij = k, but ji = -k. This non-commutative property exactly mirrors how rotations in 3D are non-commutative: rotating first around x then y is not the same as rotating first around y then x. So quaternions model rotations perfectly. A unit quaternion (norm = 1) can be written as q = cos(θ/2) + sin(θ/2)(ux i + uy j + uz k), where (ux, uy, uz) is a unit vector along the rotation axis and θ is the rotation angle. The half-angle appears because when you sandwich a vector between q and its inverse, two multiplications occur. This design keeps the rotation axis and angle neatly encoded and makes interpolating between rotations (slerp) smooth. This is why quaternions are used in animations, spacecraft orientation (like the ISS), and drone stabilization—they provide reliable, drift-free orientation tracking.

Keep FACTREE close

Internet access is required. Updates arrive when you reopen or reload the app. You may need to sign in again in the installed app.