In short
Any vector in 3D space can be written as a_1\hat{i} + a_2\hat{j} + a_3\hat{k}, where \hat{i}, \hat{j}, \hat{k} are unit vectors along the coordinate axes. The numbers a_1, a_2, a_3 are the vector's components. The angles this vector makes with the three axes are captured by direction cosines, and these cosines always satisfy \cos^2\alpha + \cos^2\beta + \cos^2\gamma = 1.
Point a torch at a wall. The beam hits the wall and makes a bright spot. Now tilt the torch upward at an angle. The spot on the wall does not move straight up — it moves both upward and sideways (if you tilted at an angle to the wall). One tilt, two effects.
This is what "resolving into components" means. A single vector — the direction the torch points — has an effect along the horizontal direction and a separate effect along the vertical direction. Breaking it apart into these separate effects is resolution, and it is the single most useful technique in all of vector mathematics.
Why? Because once you have components, every vector operation reduces to ordinary arithmetic. Adding two vectors becomes adding their x-components and their y-components separately. Finding magnitude becomes the Pythagorean theorem. Finding direction becomes trigonometry. The geometry is still there — it is just expressed as numbers you can compute.
The coordinate axes and unit vectors
Fix a coordinate system in three-dimensional space: three mutually perpendicular axes, x, y, and z. Along each axis, mark a unit vector — a vector of length 1 pointing in the positive direction:
- \hat{i}: unit vector along the x-axis
- \hat{j}: unit vector along the y-axis
- \hat{k}: unit vector along the z-axis
These three unit vectors are the building blocks. Any vector in space can be written as a sum of scaled copies of \hat{i}, \hat{j}, and \hat{k}.
Resolution into components
Take a vector \vec{a} in three-dimensional space. Drop perpendiculars from the head of \vec{a} onto each coordinate axis. The projections onto the x-, y-, and z-axes have lengths a_1, a_2, a_3 (with sign — negative if the projection points in the negative direction). Then:
The numbers a_1, a_2, a_3 are called the components (or coordinates) of the vector \vec{a}. The expression a_1\hat{i} + a_2\hat{j} + a_3\hat{k} is the component form of the vector.
In two dimensions, you drop the \hat{k} term and write \vec{a} = a_1\hat{i} + a_2\hat{j}.
In two dimensions, if \vec{a} makes angle \theta with the positive x-axis, the components have a clean trigonometric form:
This is just right-triangle trigonometry. The vector is the hypotenuse, the x-component is the adjacent side, and the y-component is the opposite side.
Consider a concrete case. A force of 10 N acts at 60° to the horizontal. Its horizontal component is 10\cos 60° = 10 \times 1/2 = 5 N, and its vertical component is 10\sin 60° = 10 \times \sqrt{3}/2 = 5\sqrt{3} N. The single force has been split into two perpendicular forces. You can analyse the horizontal and vertical effects separately — which is exactly what you do in physics when resolving forces along and perpendicular to an inclined plane.
In three dimensions, the same idea applies but with three perpendicular projections. The vector \vec{a} has a shadow on each coordinate axis, and each shadow's length (with sign) is a component. The three shadows together reconstruct the original vector completely.
Magnitude from components
If you know the components, you can recover the magnitude using the Pythagorean theorem (extended to 3D):
In 2D, this reduces to |\vec{a}| = \sqrt{a_1^2 + a_2^2}.
This is the bridge between geometry and algebra: you convert vectors to components, do arithmetic with the components, and then convert back to a magnitude and direction when you need the geometric answer.
Why components make addition trivial
Suppose \vec{a} = a_1\hat{i} + a_2\hat{j} + a_3\hat{k} and \vec{b} = b_1\hat{i} + b_2\hat{j} + b_3\hat{k}. Then:
You add the x-components, add the y-components, add the z-components. Three separate additions of ordinary numbers. The triangle law, the parallelogram law — all of that geometry is encoded in this simple rule. Components turn vector addition into something a calculator can do.
Similarly, scalar multiplication becomes:
Multiply each component by the scalar. The geometry of stretching and reversing is now just multiplication of numbers.
Direction cosines and direction ratios
A vector's direction in 3D space is fully described by the three angles it makes with the coordinate axes. These angles, and the cosines of those angles, have standard names.
Direction cosines
Let \vec{a} = a_1\hat{i} + a_2\hat{j} + a_3\hat{k} make angles \alpha, \beta, \gamma with the positive x-, y-, z-axes respectively. The direction cosines of \vec{a} are:
They are often written as l, m, n:
Each direction cosine is a component divided by the magnitude. This makes geometric sense: \cos\alpha measures how much of the vector's length is "spent" along the x-axis. If \alpha = 0, the vector lies entirely along the x-axis and \cos\alpha = 1. If \alpha = 90°, the vector is perpendicular to the x-axis and \cos\alpha = 0.
The fundamental identity
There is a constraint that direction cosines always satisfy. Since a_1 = |\vec{a}|l, a_2 = |\vec{a}|m, a_3 = |\vec{a}|n:
But also a_1^2 + a_2^2 + a_3^2 = |\vec{a}|^2 (from the magnitude formula). Dividing both sides by |\vec{a}|^2:
This identity is not a coincidence — it says that the unit vector in the direction of \vec{a} lies on the unit sphere. The three direction cosines are the coordinates of a point on a sphere of radius 1, and every point on that sphere satisfies x^2 + y^2 + z^2 = 1.
This gives you a quick check: whenever you compute direction cosines, square them and add. If the sum is not 1, you have made an error.
Direction ratios
In practice, direction cosines involve square roots (because the magnitude is usually a square root). It is often easier to work with direction ratios, which are any three numbers proportional to the direction cosines.
If \vec{a} = a_1\hat{i} + a_2\hat{j} + a_3\hat{k}, then a_1 : a_2 : a_3 are direction ratios of \vec{a}.
Direction ratios are not unique. The vector 2\hat{i} + 3\hat{j} + 6\hat{k} has direction ratios 2 : 3 : 6, but also 4 : 6 : 12 (multiply each by 2), or 1 : 3/2 : 3 (divide each by 2). Any scalar multiple works. Direction cosines, by contrast, are unique (up to sign) — there is exactly one set of cosines that sums in squares to 1.
To convert direction ratios a : b : c to direction cosines, divide each by \sqrt{a^2 + b^2 + c^2}:
Unit vector in a given direction
A unit vector is a vector with magnitude 1. Every nonzero vector has a unique unit vector pointing in the same direction, obtained by dividing the vector by its own magnitude:
If \vec{a} = a_1\hat{i} + a_2\hat{j} + a_3\hat{k}, then:
The components of \hat{a} are exactly the direction cosines l, m, n. So a unit vector and its direction cosines carry the same information: the pure direction, with the magnitude stripped away.
This operation — dividing by the magnitude — is called normalisation. You are "normalising" the vector to have length 1 while keeping its direction. It is one of the most common operations in physics and computer graphics: whenever you care about direction but not magnitude, you normalise.
Vector joining two points
If A = (x_1, y_1, z_1) and B = (x_2, y_2, z_2) are two points in space, the vector from A to B is:
This is the difference of the position vectors: \overrightarrow{AB} = \vec{b} - \vec{a}, where \vec{a} and \vec{b} are the position vectors of A and B.
The magnitude of \overrightarrow{AB} is the distance between A and B:
This is the distance formula in 3D — the Pythagorean theorem applied twice. First in the xy-plane to get the horizontal distance, then once more incorporating the z-component. The vector framework gives you the distance formula, the direction of the line joining the two points, and the unit vector along that direction, all from one subtraction.
Direction of the line joining two points
The direction ratios of the line from A(x_1, y_1, z_1) to B(x_2, y_2, z_2) are simply (x_2 - x_1) : (y_2 - y_1) : (z_2 - z_1) — the components of \overrightarrow{AB}. The direction cosines are obtained by dividing each of these by the distance |\overrightarrow{AB}|.
Note that the direction from A to B is the opposite of the direction from B to A: the vector \overrightarrow{BA} = -\overrightarrow{AB}. The direction ratios change sign, but they still represent the same line (just traversed in the opposite direction). The direction cosines also change sign. If you only care about the line and not the direction of traversal, then direction ratios (a : b : c) and (-a : -b : -c) represent the same line.
Worked examples
Example 1: Direction cosines of a vector
Find the direction cosines and the unit vector of \vec{a} = 2\hat{i} - 3\hat{j} + 6\hat{k}.
Step 1. Compute the magnitude.
Why: the magnitude is the 3D Pythagorean theorem. The clean answer 7 is a sign that the numbers were chosen kindly — 2, 3, 6 is one of the classic Pythagorean-like triples that give an integer magnitude in 3D.
Step 2. Compute the direction cosines.
Why: each direction cosine is the corresponding component divided by the magnitude. The negative sign on m means the vector points in the negative y-direction — its angle with the positive y-axis is obtuse.
Step 3. Verify the fundamental identity.
Why: this is the mandatory check. If this sum were not 1, something would be wrong.
Step 4. Write the unit vector.
Why: the unit vector is just the direction cosines assembled into component form. It has magnitude 1 and points in the same direction as \vec{a}.
Result: Direction cosines are \frac{2}{7}, -\frac{3}{7}, \frac{6}{7}. Unit vector is \hat{a} = \frac{2}{7}\hat{i} - \frac{3}{7}\hat{j} + \frac{6}{7}\hat{k}.
The triple (2, 3, 6) appears frequently in Indian textbooks and competitive exams precisely because \sqrt{4+9+36} = 7 — an integer. Other clean triples to remember: (1, 2, 2) gives magnitude 3, and (3, 4, 0) gives magnitude 5 (the familiar Pythagorean triple).
Example 2: Vector joining two points
Find the vector from A(1, -2, 4) to B(4, 2, -2). Also find its magnitude, direction ratios, and the unit vector along \overrightarrow{AB}.
Step 1. Compute \overrightarrow{AB}.
Why: the vector from A to B is found by subtracting the coordinates of A from those of B, component by component. This is \vec{b} - \vec{a} in position vector language.
Step 2. Compute the magnitude.
Why: \sqrt{61} does not simplify — 61 is prime. This is the distance between points A and B in 3D space.
Step 3. Read off the direction ratios and compute direction cosines.
Direction ratios: 3 : 4 : -6.
Direction cosines:
Why: direction ratios are just the components themselves. Direction cosines normalise them by dividing by the magnitude.
Step 4. Write the unit vector.
Result: \overrightarrow{AB} = 3\hat{i} + 4\hat{j} - 6\hat{k}, |\overrightarrow{AB}| = \sqrt{61}, direction ratios 3:4:-6, unit vector \frac{1}{\sqrt{61}}(3\hat{i} + 4\hat{j} - 6\hat{k}).
Notice the interplay between 2D and 3D: in the xy-plane alone, \overrightarrow{AB} looks like a 3-4-5 vector. But the z-component of -6 adds substantially to the total length, pushing the magnitude from 5 up to \sqrt{61} \approx 7.81. A 2D picture always underestimates a 3D distance.
Common confusions
-
"Direction cosines can be any three numbers." They cannot. Direction cosines must satisfy l^2 + m^2 + n^2 = 1. If someone tells you the direction cosines are 1/2, 1/3, 1/4, check: 1/4 + 1/9 + 1/16 = 0.4236 \neq 1. Those are not valid direction cosines. They might be direction ratios, but direction ratios come with no constraint — any three numbers (not all zero) are valid direction ratios.
-
"A vector has unique direction ratios." It does not. Direction ratios are defined only up to a scalar multiple. The vector 2\hat{i} + 4\hat{j} + 6\hat{k} has direction ratios 2:4:6, or equivalently 1:2:3, or -3:-6:-9. All of these represent the same direction. Direction cosines, on the other hand, are unique (for a given direction).
-
"The vector from A to B is \vec{a} - \vec{b}." It is \vec{b} - \vec{a}. The rule is: position vector of the head minus position vector of the tail. \overrightarrow{AB} goes from A to B, so B is the head: \overrightarrow{AB} = \vec{b} - \vec{a}.
-
"The components of a vector depend on the vector alone." They depend on the vector and the coordinate system. Rotate the axes, and the same physical vector will have different components. The magnitude and the actual direction in space do not change — only the numbers representing them change. This is why components are a representation, not the vector itself.
-
"Direction cosines are always positive." They can be negative. If a vector points in the negative y-direction, its direction cosine m = \cos\beta is negative (because \beta > 90°). The sign tells you which side of the axis the vector leans toward.
Going deeper
If you came here to learn components, direction cosines, and the vector joining two points, you have it — you can stop here. What follows is for readers who want to see the deeper structure behind resolution.
Why three components are enough
In three-dimensional space, any vector can be written as a_1\hat{i} + a_2\hat{j} + a_3\hat{k}, and the decomposition is unique. This means \hat{i}, \hat{j}, \hat{k} form a basis for 3D space — a minimal set of vectors such that every vector can be expressed as a combination of them.
The key property is that \hat{i}, \hat{j}, \hat{k} are linearly independent: no one of them can be written as a combination of the other two. (You cannot build a z-direction vector from x- and y-direction vectors.) Any three linearly independent vectors in 3D space form a basis — not just the standard unit vectors. The standard unit vectors are simply the most convenient choice because they are mutually perpendicular and have unit length.
The number of vectors in a basis is the dimension of the space. A line is one-dimensional (one basis vector), a plane is two-dimensional, and our space is three-dimensional. This is why you need exactly three components — no more, no less — to specify a vector in 3D.
The angle between a vector and a coordinate plane
A vector makes angles with the coordinate axes, but it also makes an angle with each coordinate plane. The angle with the xy-plane, for instance, is 90° - \gamma (the complement of the angle with the z-axis). If the direction cosine with the z-axis is \cos\gamma = 6/7, then \gamma \approx 31.0° and the angle with the xy-plane is approximately 90° - 31° = 59°.
This complementary relationship is useful in physics. When you resolve a velocity into horizontal and vertical components, the angle you use is typically the angle with the horizontal plane, not with the vertical axis. The trigonometric functions swap: if the angle with the plane is \phi, then the component along the axis perpendicular to the plane is |\vec{a}|\sin\phi, not |\vec{a}|\cos\phi.
Projections and components are different concepts
The component of \vec{a} along \hat{i} is a number: a_1 = \vec{a} \cdot \hat{i} (using the dot product). The projection of \vec{a} onto the x-axis is a vector: a_1\hat{i}. The component is the scalar; the projection is the vector. In everyday usage, people often say "component" for both. But in formal work — especially when you study the dot product — the distinction matters.
The dot product formula \vec{a} \cdot \hat{i} = a_1 is a preview of a much more general idea: the component of \vec{a} along any direction \hat{u} is \vec{a} \cdot \hat{u}. The coordinate axes are not special — you can project onto any direction. Components along the standard axes are just the most common case.
Equal vectors in component form
Two vectors \vec{a} = a_1\hat{i} + a_2\hat{j} + a_3\hat{k} and \vec{b} = b_1\hat{i} + b_2\hat{j} + b_3\hat{k} are equal if and only if:
One vector equation in 3D space is equivalent to three scalar equations. This fact is used constantly in problem-solving: when you set two vectors equal and extract three separate equations, you are using the uniqueness of the component decomposition. In competition mathematics, this technique — "equating components" — converts a single vector equation into a system of scalar equations that you can solve by standard methods.
The direction cosines of the coordinate axes
The direction cosines of the x-axis are \cos 0° = 1, \cos 90° = 0, \cos 90° = 0, i.e., (1, 0, 0). This is just \hat{i}. Similarly, the y-axis has direction cosines (0, 1, 0) = \hat{j}, and the z-axis has (0, 0, 1) = \hat{k}.
A vector that makes equal angles with all three axes has \cos\alpha = \cos\beta = \cos\gamma. By the fundamental identity:
So the direction cosines are \left(\frac{1}{\sqrt{3}}, \frac{1}{\sqrt{3}}, \frac{1}{\sqrt{3}}\right) or its negative. This vector points along the main diagonal of a cube — the line from one corner of a cube to the diametrically opposite corner. The angle it makes with each axis is \arccos(1/\sqrt{3}) \approx 54.74°, which is not 45° (a common mistake). In two dimensions, the line y = x makes 45° with each axis. In three dimensions, the body diagonal of a cube makes a larger angle, because the "room" is shared among three axes instead of two.
Where this leads next
- Vector Operations — the addition and scalar multiplication rules that you now know how to execute component-wise.
- Collinearity and Coplanarity — how to use components to test whether vectors (or points) lie on the same line or the same plane.
- Dot Product — a multiplication of two vectors that gives a number, defined most cleanly through components: \vec{a} \cdot \vec{b} = a_1b_1 + a_2b_2 + a_3b_3.
- Cross Product — a multiplication that gives a vector, computable through a 3 \times 3 determinant of the component matrix.
- Coordinate Geometry Basics — the distance, section, and midpoint formulas in coordinate form, which are the component versions of the vector formulas.