Quaternions are central to subjects involving 3D rotations such as computer vision, graphics, robotics, and physics. Even though quaternions were the original source of the 3D vector operations that most are familiar with, the dot and cross products, they all too often remain shrouded in mystery. There is a common misconception that understanding these complex algebraic objects requires a special capacity to imagine non-intuitive 4-dimensional spaces, but I am here to tell you that this is not the case!

Some aspects of quaternions and how they are used may seem a bit mysterious:
- Why do quaternions require 4 variables to rotate a point in 3d?
- Why do quaternions use only half of the intended rotation angle?
- How could Hamilton have conceived of quaternions before the standard vector operations were invented?
Hopefully I can help illuminate these questions and more. I'd like to present a mathematical story about a way that quaternions could have been motivated and discovered. We'll start in 0 dimensions and work our way up. At each level we'll look at points within the space and operations on them, before coming to focus on rotations and then on 3D rotations in particular. At the end we'll look forward toward what's called the Clifford or geometric algebra, which further clarifies and builds on the story presented here.
Although I've attempted to work "from scratch" and make this article as self-contained as possible, my main objectives are to clarify and build intuitions about how and why quaternions work the way they do. If this is your first introduction to the topic, expect to require other materials to be able to follow through the whole thing! This is intended to be a supplement, rather than a replacement. I've tried to emphasize algebraic and geometric perspectives that I've found useful both for my own mathematical intuition building and for working with 3d software tools and libraries, but I hope this article can be enjoyed by anyone interested in quaternions for whatever reason!