The many modern uses of quaternions

That’s Maths: A surprising application is to electric toothbrushes but they have many vital functions

The story of William Rowan Hamilton’s discovery of new four-dimensional numbers called quaternions is familiar. The solution of a problem that had bothered him for years occurred to him in a flash of insight as he walked along the Royal Canal in Dublin. But this eureka moment did not arise spontaneously: it was the result of years of intense effort. The great French mathematician Henri Poincaré also described how sudden inspiration occurs unexpectedly, but always following a period of concentrated research.

Hamilton carved his quaternion formula on Broombridge, where the answer had come to him. This was on October 16th, 1843, and a plaque on the bridge commemorates the event. Every year, Hamilton's many contributions to mathematics and science are celebrated on this day by a walk, retracing Hamilton's steps from Dunsink Observatory to Broombridge – Click "events" at for details of this year's walk.

Hamilton knew immediately that his discovery would keep him occupied for many years. He and his followers used quaternions for solving problems in mechanics and optics. Quaternions were popular for a time but could be cumbersome to use and were supplanted by more manageable objects called vectors. They languished in obscurity for a century or more but have re-emerged recently in several contexts. Today, quaternions have applications in astronautics, robotics, computer visualisation, animation and special effects in movies, navigation and many other areas.

Aircraft and rockets

Quaternions are vital for the control systems that guide aircraft and rockets. Let us think of an aircraft in flight. Changes in its orientation can be given by three rotations known as pitch, roll and yaw, represented by three arrays of numbers called matrices. But when two rotation axes align, an ambiguity arises that can result in catastrophic loss of control. This is called gimbal lock, and can lead to disaster. During the Apollo 11 moon mission, the spaceflight that landed the first two people on the moon, an incident involving gimbal lock occurred on the inertial measurement unit of the lunar module.


The mathematical properties of unit quaternions (those with length equal to 1) make them ideal for representing rotations in three dimensions. Each quaternion has an axis giving its direction and a magnitude giving the size of the rotation. Instead of representing a change of orientation by three separate rotations, quaternions use just one rotation. This saves time and storage and also solves the problem of gimbal lock.

Electric toothbrushes

One surprising application of quaternions is to electric toothbrushes. Tooth brushing is a blind process: you cannot easily see what you are doing or gauge the results of brushing. Quaternions have been used in the design of a system that tracks the position of a toothbrush in the mouth relative to the user’s teeth. It automatically compensates for movements of the head during brushing.

Finally, the 13th annual Maths Week Ireland runs from October 13th to 21st. Yes, this is nine days, not the seven in a typical week. But then, mathematicians are notoriously poor at arithmetic!

Peter Lynch is emeritus professor at UCD school of mathematics and statistics. He blogs at