Unit quaternions, known as versors, provide a convenient mathematical notation for representing spatial orientations and rotations of elements in three dimensional space. Specifically, they encode information about an axis-angle rotation about an arbitrary axis. Rotation and orientation quaternions have applications in computer graphics, computer vision, robotics, navigation, molecular dynamics, flight dynamics, orbital mechanics of satellites, and crystallographic texture analysis.
When used to represent rotation, unit quaternions are also called rotation quaternions as they represent the 3D rotation group. When used to represent an orientation (rotation relative to a reference coordinate system), they are called orientation quaternions or attitude quaternions. A spatial rotation around a fixed point of radians about a unit axis that denotes the Euler axis is given by the quaternion , where and .
Compared to rotation matrices, quaternions are more compact, efficient, and numerically stable. Compared to Euler angles, they are simpler to compose. However, they are not as intuitive and easy to understand and, due to the periodic nature of sine and cosine, rotation angles differing precisely by the natural period will be encoded into identical quaternions and recovered angles in radians will be limited to .
In 3-dimensional space, according to Euler's rotation theorem, any rotation or sequence of rotations of a rigid body or coordinate system about a fixed point is equivalent to a single rotation by a given angle about a fixed axis (called the Euler axis) that runs through the fixed point. The Euler axis is typically represented by a unit vector ( in the picture). Therefore, any rotation in three dimensions can be represented as via a vector and an angle .
Quaternions give a simple way to encode this axis–angle representation using four real numbers, and can be used to apply (calculate) the corresponding rotation to a position vector (x,y,z), representing a point relative to the origin in R3.