# Maths - Direction Cosines

## Prerequisites

Vectors can be used to represent direction.

If you are not familiar with this subject you may like to look at the following pages first:

## Vector representation of direction A 3D vector can be used to define a direction. If a vector is used to define direction in this way then the length of the vector is not relevant, therefore we can use a unit length vector.

So if the vector is: (x,y,z)

where:

• x is the length of the vector in the x dimension.
• y is the length of the vector in the y dimension.
• z is the length of the vector in the z dimension.

So for a normalised vector:

x2 + y2 + z2 = 1

The angles from the vector to the coordinate axes are given by:

• x = cos(alpha)
• y = cos(beta)
• z = cos(gamma)

x,y and z are known as the direction cosines.

## Distinction between Direction and Orientation

The direction cosines are not independent of each other, they are related by the equation x2 + y2 + z2 = 1, so direction cosines only have two degrees of freedom and can only represent direction and not orientation.

What this means is that direction cosines do not define how much an object is rotated around the axis of the vector.

 metadata block see also: Correspondence about this page Book Shop - Further reading. Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.       3D Math Primer - Aimed at complete beginners to vector and matrix algebra. Other Math Books