# Representing Orientation in 3-Dimensions

There are a number of ways to represent the orientation of an object in 3-dimensions.  One common way is to use Euler angles (like pitch, roll, and yaw). Euler angles were developed by Leonhard Euler, a brilliant 18th century Swiss mathematician.  There are, however, ambiguities that arise when using this convention.  If the pitch happens to be ± 90 degrees, then rotations in roll and rotations in yaw produce the same result.  This is called gimbal lock.  As a result, other alternatives have been developed to represent orientations in 3-dimensions that do not exhibit this problem.

One alternate method is to use a platform (or rotation) matrix.  Think of an object represented by a tri-axial coordinate system (XYZ).  If each axis was represented by a unit vector that points in the direction of the positive axis, then we could combine these vectors to produce a 3×3 matrix.  If a 3D object was oriented North and level, the platform matrix would just be the identity matrix.  As the object rotates, the platform matrix will accurately define the direction of each of the coordinate axes (XYZ) and provide an unambiguous definition of the orientation of that object.  The drawback with this approach is that it requires a 3×3 matrix or 9 total elements to represent the object’s orientation.

Another alternative method is to use what is known as a quaternion.  A quaternion is a 4-dimensional, hyper-complex number that has some rather unique properties.  It is analogous to 2-dimensional complex numbers in that it can rotate objects by multiplication just like regular complex number.  If you multiply a 2D object by a unit-complex number, you rotate that object in the 2D plane.  Similarly, if you multiply a 4D object by a unit-quaternion, you rotate that object in 4D space which can then be translated to 3D space fairly easily.  The quaternion can represent the orientation of a 3D object with only 4 elements like (qw, qx, qy,qz) where each element of the quaternion is orthogonal to the others.

There are even other methods like the axis-angle representation that looks very similar to the quaternion, but can represent 3D orientation with as little as 3 elements (rotation angle x unit vector).  The unit vector represents the axis around which the object is rotated.  The problem with this approach is that it is impractical to apply successive rotations to an object when it is represented in this format.

Sparton NavEx products have a selectable output format.  The user can select between standard Euler angles (pitch, roll, and yaw), quaternions, or even the platform matrix.  If an application requires a unique format, a NorthTek™ script can be used to generate a custom output for almost any application.