In
analytic geometry, the direction cosines (or directional cosines) of a
vector are the
cosine
In mathematics, sine and cosine are trigonometric functions of an angle. The sine and cosine of an acute angle are defined in the context of a right triangle: for the specified angle, its sine is the ratio of the length of the side opposite that ...
s of the angles between the vector and the three positive coordinate axes. Equivalently, they are the contributions of each component of the
basis to a
unit vector
In mathematics, a unit vector in a normed vector space is a Vector (mathematics and physics), vector (often a vector (geometry), spatial vector) of Norm (mathematics), length 1. A unit vector is often denoted by a lowercase letter with a circumfle ...
in that
direction.
Three-dimensional Cartesian coordinates

If is a
Euclidean vector
In mathematics, physics, and engineering, a Euclidean vector or simply a vector (sometimes called a geometric vector or spatial vector) is a geometric object that has magnitude (or length) and direction. Euclidean vectors can be added and scal ...
in
three-dimensional
In geometry, a three-dimensional space (3D space, 3-space or, rarely, tri-dimensional space) is a mathematical space in which three values (''coordinates'') are required to determine the position (geometry), position of a point (geometry), poi ...
Euclidean space
Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are ''Euclidean spaces ...
,
where are the
standard basis
In mathematics, the standard basis (also called natural basis or canonical basis) of a coordinate vector space (such as \mathbb^n or \mathbb^n) is the set of vectors, each of whose components are all zero, except one that equals 1. For exampl ...
in Cartesian notation, then the direction cosines are
It follows that by squaring each equation and adding the results
Here are the direction cosines and the Cartesian coordinates of the
unit vector
In mathematics, a unit vector in a normed vector space is a Vector (mathematics and physics), vector (often a vector (geometry), spatial vector) of Norm (mathematics), length 1. A unit vector is often denoted by a lowercase letter with a circumfle ...
and are the direction angles of the vector .
The direction angles are
acute or
obtuse angles, i.e., , and , and they denote the angles formed between and the unit basis vectors .
General meaning
More generally, direction cosine refers to the cosine of the angle between any two
vectors. They are useful for forming
direction cosine matrices that express one set of
orthonormal basis vectors in terms of another set, or for expressing a known
vector in a different basis. Simply put, direction cosines provide an easy method of representing the direction of a vector in a Cartesian coordinate system.
Applications
Determining angles between two vectors
If vectors and have direction cosines and respectively, with an angle between them, their units vectors are
Taking the
dot product
In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a Scalar (mathematics), scalar as a result". It is also used for other symmetric bilinear forms, for example in a pseudo-Euclidean space. N ...
of these two unit vectors yield,
where is the angle between the two unit vectors, and is also the angle between and .
Since is a geometric angle, and is never negative. Therefore only the positive value of the dot product is taken, yielding us the final result,
See also
*
Cartesian tensor
*
Euler angles
References
*
*
*
*
*
Algebraic geometry
Vectors (mathematics and physics)
{{Geometry-stub