Hamilton's Quaternions

On October 16, 1843, the Irish mathematician William Rowan Hamilton was walking along the Royal Canal in Dublin with his wife when an equation hit him so hard he carved it into the stone of Brougham Bridge with a knife. The equation: i² = j² = k² = ijk = -1. He'd just invented the quaternions, a number system with four dimensions instead of two. The original carving is long gone, but a plaque marks the spot, and mathematicians retrace his walk every year on the anniversary.

What Hamilton figured out that day was that you could extend complex numbers (which have one real and one imaginary part) into four dimensions by adding two more imaginary axes. The cost: multiplication stops being commutative. i × j = k, but j × i = -k. Order matters.

q = w + xi + yj + zk where i² = j² = k² = ijk = -1

A regular Julia set takes 2D complex numbers and iterates z → z² + c. Quaternion Julia sets do the same thing, but with these 4D numbers instead.

q(n+1) = q(n)² + c where q = (x, y, z, w) and c = (cx, cy, cz, cw)

Viewing a 4D Shape

You can't see a 4D object. So what you're actually looking at when you see a "quaternion Julia set" is a 3D slice through a 4D shape. If you had a 3D sculpture and could only see 2D cross-sections of it (like an MRI scan), each slice would show a different contour. Same idea here, but one dimension up.

Change which 3D hyperplane you slice along, and the same fractal looks completely different. A bulging, organic mass at one slice angle becomes a spiky lattice at another. The object hasn't changed; only your cut through it has.

What They Look Like

Quaternion Julia sets tend to produce rounded, blobby shapes with fractal surface detail. At certain c values they look like bones or coral. At others, like crumpled fabric or sea creatures. The non-commutative multiplication gives them a handedness that regular Julia sets lack, so you get spiral structures that twist preferentially left or right depending on the parameters.

Tweak the four components of c by small amounts and the shape can shift from a smooth connected blob to a shattered dust of disconnected fragments. As with the 2D Julia set, the most detailed shapes sit near the boundary between connected and disconnected.

Exploring It

3D Orbital View

Circles the fractal so you can see the full 3D shape of the current slice.

3D Flythrough

Flies the camera through the geometry. Good for seeing how the surface folds inward.

C Parameter Morphing

Sweeps through different c values, so the 4D shape itself deforms in real time. It shows most directly how the parameters change the shape.

3D Deep Zoom

Pushes into the fractal surface to find self-similar detail at smaller scales.

Interactive Navigation

Full manual control. WASD to move, QE for up/down, mouse or touch to rotate.

Why Quaternions Matter Outside Fractals

Hamilton's quaternions spent decades as a mathematical curiosity. That changed with 3D computer graphics: quaternions are the cleanest way to represent rotations in three-dimensional space. They avoid gimbal lock (the nasty singularity that Euler angles hit), they interpolate smoothly, and they compose efficiently. Game engines, robot arm controllers and spacecraft attitude systems all use them.

The same algebraic structure that produces these fractals also tracks your phone's screen orientation and keeps aircraft attitude control stable.

Tips

Start with c values near the origin, something like (0.3, 0.3, 0.1, 0.0). Connected shapes live close to zero. Push the values past about 0.5 in any component and the set usually shatters into dust.

The C Parameter Morphing animation is the best way to build intuition for how the 4D parameter space works. Watch how the shape inflates, pinches, and breaks apart as c moves.

Use the orbital view to understand the full 3D structure before zooming in. The surface folds and pockets only become visible when you rotate around them.

Further Reading