# Quaternion - Quaternions and The Geometry of R3

Quaternions and The Geometry of R3

Because the vector part of a quaternion is a vector in R3, the geometry of R3 is reflected in the algebraic structure of the quaternions. Many operations on vectors can be defined in terms of quaternions, and this makes it possible to apply quaternion techniques wherever spatial vectors arise. For instance, this is true in electrodynamics and 3D computer graphics.

For the remainder of this section, i, j, and k will denote both imaginary basis vectors of H and a basis for R3. Notice that replacing i by −i, j by −j, and k by −k sends a vector to its additive inverse, so the additive inverse of a vector is the same as its conjugate as a quaternion. For this reason, conjugation is sometimes called the spatial inverse.

Choose two imaginary quaternions p = b1i + c1j + d1k and q = b2i + c2j + d2k. Their dot product is

This is equal to the scalar parts of p*q, qp*, pq*, and q*p. (Note that the vector parts of these four products are different.) It also has the formulas

The cross product of p and q relative to the orientation determined by the ordered basis i, j, and k is

(Recall that the orientation is necessary to determine the sign.) This is equal to the vector part of the product pq (as quaternions), as well as the vector part of −q*p*. It also has the formula

In general, let p and q be quaternions (possibly non-imaginary), and write

where ps and qs are the scalar parts of p and q and and are the vector parts of p and q. Then we have the formula

This shows that the noncommutativity of quaternion multiplication comes from the multiplication of pure imaginary quaternions. It also shows that two quaternions commute if and only if their vector parts are collinear.

For further elaboration on modeling three-dimensional vectors using quaternions, see quaternions and spatial rotation.