NDA Maths · Vectors

Magnitude, Components, Projection, Direction Cosines

How to measure a vector's length, decompose it along axes, project it onto another vector, and read off the angles it makes with the coordinate axes.

Why this matters

This is where you learn to MEASURE vectors. How long is one (its magnitude)? At what angles to the coordinate axes does it point (its direction cosines)? How much of one vector lies along another (its scalar projection)? And how do you build a unit vector pointing exactly where you want it? Each of these turns the geometric arrow from the foundations into a number you can compute with. 11 PYQs across 2018–2024, almost entirely EASY or MODERATE — the formulas are short and the trap surface is narrow, so it's also the lowest-hanging-fruit subtopic in the chapter.

Concept 1 of 4

Magnitude of a vector and distance between two points

Intuition

The magnitude of a vector is its length — extended Pythagoras applied to its components. The distance between two points is the magnitude of the displacement vector joining them, which is also why AB=ba\overrightarrow{AB}=\vec{b}-\vec{a}: subtract the tail's position vector from the head's.

Definition

If v=v1i^+v2j^+v3k^\vec{v} = v_1\hat{i} + v_2\hat{j} + v_3\hat{k}, then v=v12+v22+v32|\vec{v}| = \sqrt{v_1^2 + v_2^2 + v_3^2}. For two points A,BA, B with position vectors a,b\vec{a}, \vec{b}: AB=ba\overrightarrow{AB} = \vec{b} - \vec{a} and AB=baAB = |\vec{b} - \vec{a}|.

Magnitude and distance

v=v12+v22+v32AB=ba|\vec{v}| = \sqrt{v_1^2 + v_2^2 + v_3^2} \qquad AB = |\vec{b} - \vec{a}|
  • v1,v2,v3v_1, v_2, v_3components of v\vec{v} along i^,j^,k^\hat{i}, \hat{j}, \hat{k}
  • a,b\vec{a}, \vec{b}position vectors of the endpoints

Diagram · magnitude = √(x² + y²)

x = 4y = 3|v| = 5

The components x and y are the legs of a right triangle; the vector is the hypotenuse, so |v| = √(x² + y²) = √(16 + 9) = 5. In 3-D the same idea adds a third leg: |v| = √(x² + y² + z²).

Worked example

Position vectors of points AA and BB are a=2i^+j^k^\vec{a} = 2\hat{i} + \hat{j} - \hat{k} and b=5i^+5j^+11k^\vec{b} = 5\hat{i} + 5\hat{j} + 11\hat{k}. Find the length ABAB.
  1. Subtract position vectors: AB=ba=(52)i^+(51)j^+(11(1))k^=3i^+4j^+12k^\overrightarrow{AB} = \vec{b} - \vec{a} = (5-2)\hat{i} + (5-1)\hat{j} + (11-(-1))\hat{k} = 3\hat{i} + 4\hat{j} + 12\hat{k}.
  2. Square each component: 32+42+122=9+16+144=1693^2 + 4^2 + 12^2 = 9 + 16 + 144 = 169.
  3. Take the square root: AB=169=13AB = \sqrt{169} = 13.
Answer:AB=13AB = 13 units
Practice this conceptself-check · 4 quick reps

Try it yourself

Find the magnitude of v=2i^3j^+6k^\vec{v} = 2\hat{i} - 3\hat{j} + 6\hat{k}.

Practice — Level 1 (4 reps)

Quick reps to lock in the method. Try each, then check.

  1. 1.
    v|\vec{v}| for v=3i^+4j^\vec{v} = 3\hat{i} + 4\hat{j}?
  2. 2.
    v|\vec{v}| for v=i^+2j^+2k^\vec{v} = \hat{i} + 2\hat{j} + 2\hat{k}?
  3. 3.
    Distance ABAB for A(0,0,0)A(0,0,0), B(1,2,2)B(1,2,2)?
  4. 4.
    v|\vec{v}| for v=6i^+8j^\vec{v} = 6\hat{i} + 8\hat{j}?

From the bank · past-year question

Example 1VectorsEASY
If the position vectors of points A and B are 3i^2j^+k^3\hat{i}-2\hat{j}+\hat{k} and 2i^+4j^3k^2\hat{i}+4\hat{j}-3\hat{k} respectively, then what is the length of AB\overrightarrow{AB}?

[Q67 · Apr · 2019]

AB\overrightarrow{AB} is ba\vec{b} - \vec{a} — head minus tail

Reverse the subtraction and you get BA\overrightarrow{BA} — the magnitude is the same but the displacement points the other way. Direction matters whenever the result feeds into a dot product or angle.

Lagrange identity gives you the missing magnitude

Whenever a question gives a×b2+(ab)2=k|\vec{a}\times\vec{b}|^2 + (\vec{a}\cdot\vec{b})^2 = k together with one magnitude, use the identity a2b2=a×b2+(ab)2|\vec{a}|^2|\vec{b}|^2 = |\vec{a}\times\vec{b}|^2 + (\vec{a}\cdot\vec{b})^2 to read the other magnitude off directly. (The same identity is the central formula of a×b\vec{a}\times\vec{b} magnitude work — see the cross-product note.)

Concept 2 of 4

Direction Cosines

Intuition

If a vector makes angles α,β,γ\alpha, \beta, \gamma with the positive x,y,zx, y, z axes, its direction cosines are cosα,cosβ,cosγ\cos\alpha, \cos\beta, \cos\gamma — exactly the components of the unit vector along v\vec{v}. Their squares sum to 1 (Pythagoras on the unit sphere). From this, the sum of the sines squared is forced to be 2 — the most-tested sister identity.

Definition

For v=v1i^+v2j^+v3k^\vec{v} = v_1\hat{i} + v_2\hat{j} + v_3\hat{k} of magnitude v|\vec{v}|, the direction cosines are l=cosα=v1v,  m=cosβ=v2v,  n=cosγ=v3vl = \cos\alpha = \dfrac{v_1}{|\vec{v}|}, \; m = \cos\beta = \dfrac{v_2}{|\vec{v}|}, \; n = \cos\gamma = \dfrac{v_3}{|\vec{v}|}. They satisfy l2+m2+n2=1l^2 + m^2 + n^2 = 1, and consequently sin2α+sin2β+sin2γ=2\sin^2\alpha + \sin^2\beta + \sin^2\gamma = 2.

Direction-cosine identities

cos2α+cos2β+cos2γ=1sin2α+sin2β+sin2γ=2\cos^2\alpha + \cos^2\beta + \cos^2\gamma = 1 \qquad \sin^2\alpha + \sin^2\beta + \sin^2\gamma = 2
  • α,β,γ\alpha, \beta, \gammaangles between v\vec{v} and the positive x,y,zx, y, z axes
  • l,m,nl, m, ndirection cosines (the unit vector's components)

Diagram · direction cosines (drag to rotate)

xyzr
α ≈ 49° · l = 0.66β ≈ 62° · m = 0.48γ ≈ 54° · n = 0.58

l, m, n are the cosines of the angles r makes with the x-, y-, z-axes — and the components of the unit vector along r. So l² + m² + n² = 1.00 = 1, always.

Worked example

A vector a=4i^8j^+k^\vec{a} = 4\hat{i} - 8\hat{j} + \hat{k} makes angles α,β,γ\alpha, \beta, \gamma with the positive axes. Find cosα\cos\alpha and verify the identity cos2α+cos2β+cos2γ=1\cos^2\alpha + \cos^2\beta + \cos^2\gamma = 1.
  1. Magnitude: a=16+64+1=81=9|\vec{a}| = \sqrt{16 + 64 + 1} = \sqrt{81} = 9.
  2. Direction cosines: cosα=49\cos\alpha = \tfrac{4}{9}, cosβ=89\cos\beta = -\tfrac{8}{9}, cosγ=19\cos\gamma = \tfrac{1}{9}.
  3. Sum of squares: 1681+6481+181=8181=1\dfrac{16}{81} + \dfrac{64}{81} + \dfrac{1}{81} = \dfrac{81}{81} = 1. \checkmark
Answer:cosα=49\cos\alpha = \dfrac{4}{9}; identity holds.
Practice this conceptself-check · 4 quick reps

Try it yourself

A vector makes 6060^\circ with the xx-axis and 6060^\circ with the yy-axis. Find cosγ\cos\gamma, where γ\gamma is the angle with the zz-axis.

Practice — Level 1 (4 reps)

Quick reps to lock in the method. Try each, then check.

  1. 1.
    cosα\cos\alpha for a=i^+2j^+2k^\vec{a} = \hat{i} + 2\hat{j} + 2\hat{k}?
  2. 2.
    What does l2+m2+n2l^2 + m^2 + n^2 equal?
  3. 3.
    If l=13l = \tfrac{1}{3}, m=23m = \tfrac{2}{3}, find nn (positive).
  4. 4.
    sin2α+sin2β+sin2γ=?\sin^2\alpha + \sin^2\beta + \sin^2\gamma = ?

From the bank · past-year question

Example 2VectorsEASY
Consider the following for the items that follow: Let a vector a=4i^8j^+k^\vec{a}=4\hat{i}-8\hat{j}+\hat{k} make angles α\alpha, β\beta, γ\gamma with the positive directions of xx, yy, zz axes respectively.
What is cosα\cos\alpha equal to?

[Q67 · Apr · 2023]

Factor-of-2 trap: sin2α+sin2β+sin2γ=2\sin^2\alpha + \sin^2\beta + \sin^2\gamma = 2, not 1

From cos2=1\sum\cos^2 = 1 and sin2=1cos2\sin^2 = 1 - \cos^2, summing three times: sin2=3cos2=31=2\sum\sin^2 = 3 - \sum\cos^2 = 3 - 1 = 2. The distractor =1= 1 (copying the cosine identity) is the single most common wrong answer in this concept.

Direction cosines can be negative

An obtuse angle with an axis gives a negative cosine — totally fine. Some students try to force l,m,n0l, m, n \geq 0; don't. The identity l2+m2+n2=1l^2 + m^2 + n^2 = 1 holds with signs.

Concept 3 of 4

Scalar projection of one vector on another

Intuition

The scalar projection of a\vec{a} on b\vec{b} measures how far a\vec{a} reaches in the direction of b\vec{b} — drop a perpendicular from the tip of a\vec{a} onto the line through b\vec{b}, and the signed length from the foot back to the origin is the projection. Algebraically it's just (ab)/b(\vec{a}\cdot\vec{b})/|\vec{b}|, where the dot product ab=a1b1+a2b2+a3b3\vec{a}\cdot\vec{b} = a_1b_1 + a_2b_2 + a_3b_3 is the sum of products of corresponding components (it gets its own full treatment in the next subtopic) — divided by the length you're projecting onto.

Definition

The scalar projection of a\vec{a} on b\vec{b} is projba=abb\text{proj}_{\vec{b}}\vec{a} = \dfrac{\vec{a}\cdot\vec{b}}{|\vec{b}|}, with ab=a1b1+a2b2+a3b3\vec{a}\cdot\vec{b} = a_1b_1 + a_2b_2 + a_3b_3. It is a signed scalar (positive when the projection lands in the direction of b\vec{b}, negative when opposite). The corresponding vector projection — projecting and keeping a vector — is abb2b\dfrac{\vec{a}\cdot\vec{b}}{|\vec{b}|^2}\vec{b}.

Scalar and vector projection

projba=abbprojba=abb2b\text{proj}_{\vec{b}}\vec{a} = \dfrac{\vec{a}\cdot\vec{b}}{|\vec{b}|} \qquad \overrightarrow{\text{proj}_{\vec{b}}\vec{a}} = \dfrac{\vec{a}\cdot\vec{b}}{|\vec{b}|^2}\,\vec{b}
  • a\vec{a}vector being projected
  • b\vec{b}vector providing the direction
  • b|\vec{b}|magnitude of b\vec{b} (NOT b2|\vec{b}|^2 for scalar version)

Worked example

Find the scalar projection of a=3i^+j^k^\vec{a} = 3\hat{i} + \hat{j} - \hat{k} on b=2i^+2j^+k^\vec{b} = 2\hat{i} + 2\hat{j} + \hat{k}.
  1. Dot product: ab=32+12+(1)1=6+21=7\vec{a}\cdot\vec{b} = 3\cdot 2 + 1\cdot 2 + (-1)\cdot 1 = 6 + 2 - 1 = 7.
  2. Magnitude of b\vec{b}: b=4+4+1=3|\vec{b}| = \sqrt{4 + 4 + 1} = 3.
  3. Scalar projection: abb=73\dfrac{\vec{a}\cdot\vec{b}}{|\vec{b}|} = \dfrac{7}{3}.
Answer:73\dfrac{7}{3}
Practice this conceptself-check · 4 quick reps

Try it yourself

Find the scalar projection of a=i^+j^+k^\vec{a} = \hat{i} + \hat{j} + \hat{k} on b=2i^+2j^+k^\vec{b} = 2\hat{i} + 2\hat{j} + \hat{k}.

Practice — Level 1 (4 reps)

Quick reps to lock in the method. Try each, then check.

  1. 1.
    Scalar projection of a\vec{a} on b\vec{b} — formula?
  2. 2.
    ab=6\vec{a}\cdot\vec{b} = 6, b=3|\vec{b}| = 3. Scalar projection?
  3. 3.
    Projection of a=2i^+j^\vec{a} = 2\hat{i} + \hat{j} on b=i^\vec{b} = \hat{i}?
  4. 4.
    If the scalar projection is negative, the angle is?

From the bank · past-year question

Example 3VectorsEASY
What is the length of projection of the vector i^+2j^+3k^\hat{i}+2\hat{j}+3\hat{k} on the vector 2i^+3j^2k^2\hat{i}+3\hat{j}-2\hat{k}?

[Q91 · Sep · 2023]

Divide by b|\vec{b}|, not b2|\vec{b}|^2, for the scalar projection

Vector projection has b2|\vec{b}|^2 in the denominator because it carries the direction b\vec{b} back into the answer; scalar projection drops the direction and divides only once. Mixing the two is a frequent factor-of-b|\vec{b}| bug.

Sign of the scalar projection encodes obtuse/acute

If the projection comes out negative, the angle between a\vec{a} and b\vec{b} is obtuse. Don't reach for absolute value automatically — the sign is the information.

Concept 4 of 4

Unit vectors and direction-given construction

Intuition

To strip a vector of its length and keep only its direction, divide by its magnitude — the result is a unit vector. To go the other way, multiply a unit vector by the desired magnitude. When a question describes a vector by its angles with axes, use the cosines of those angles as the components of its unit form, then scale.

Definition

For any non-zero v\vec{v}, the unit vector along v\vec{v} is v^=vv\hat{v} = \dfrac{\vec{v}}{|\vec{v}|}. A vector of magnitude rr making angles α,β,γ\alpha, \beta, \gamma with the positive axes is v=r(cosαi^+cosβj^+cosγk^)\vec{v} = r(\cos\alpha\,\hat{i} + \cos\beta\,\hat{j} + \cos\gamma\,\hat{k}). Special 2-D case: a unit vector in the xyxy-plane at angle θ\theta to the xx-axis is cosθi^+sinθj^\cos\theta\,\hat{i} + \sin\theta\,\hat{j}.

Unit vector and direction construction

v^=vvv=r(cosαi^+cosβj^+cosγk^)\hat{v} = \dfrac{\vec{v}}{|\vec{v}|} \qquad \vec{v} = r(\cos\alpha\,\hat{i} + \cos\beta\,\hat{j} + \cos\gamma\,\hat{k})
  • v^\hat{v}unit vector along v\vec{v}
  • rrdesired magnitude of the constructed vector
  • α,β,γ\alpha, \beta, \gammaangles with the positive coordinate axes

Worked example

Find a vector of magnitude 15 in the direction of 4i^3k^4\hat{i} - 3\hat{k}.
  1. Magnitude of the direction vector: v=42+(3)2=25=5|\vec{v}| = \sqrt{4^2 + (-3)^2} = \sqrt{25} = 5.
  2. Unit vector: v^=4i^3k^5\hat{v} = \dfrac{4\hat{i} - 3\hat{k}}{5}.
  3. Scale to magnitude 15: 15v^=3(4i^3k^)=12i^9k^15\,\hat{v} = 3(4\hat{i} - 3\hat{k}) = 12\hat{i} - 9\hat{k}.
Answer:12i^9k^12\hat{i} - 9\hat{k}
Practice this conceptself-check · 4 quick reps

Try it yourself

Find the unit vector along v=3i^4j^\vec{v} = 3\hat{i} - 4\hat{j}.

Practice — Level 1 (4 reps)

Quick reps to lock in the method. Try each, then check.

  1. 1.
    Unit vector along v=i^+j^+k^\vec{v} = \hat{i} + \hat{j} + \hat{k}?
  2. 2.
    Vector of magnitude 1010 along 3i^+4j^3\hat{i} + 4\hat{j}?
  3. 3.
    Unit vector in the xyxy-plane at angle θ\theta to the xx-axis?
  4. 4.
    Unit vector along 5i^5\hat{i}?

From the bank · past-year question

Example 4VectorsEASY
A vector r=ai^+bj^\vec{r} = a\hat{i} + b\hat{j} is equally inclined to both xx and yy axes. If the magnitude of the vector is 2 units, then what are the values of aa and bb respectively?

[Q71 · Apr · 2021]

Check that the given angles are consistent with cos2=1\sum\cos^2 = 1

A vector cannot make α=60\alpha = 60^\circ and β=45\beta = 45^\circ with the xx and yy axes AND have γ\gamma acute unless the third cosine fits. From cos2α+cos2β+cos2γ=1\cos^2\alpha + \cos^2\beta + \cos^2\gamma = 1: cos2γ=11412=14\cos^2\gamma = 1 - \tfrac{1}{4} - \tfrac{1}{2} = \tfrac{1}{4}, so γ=60\gamma = 60^\circ (acute) or 120120^\circ.

Equally inclined to two axes only fixes one component pair

\"Vector inclined equally to xx and yy axes\" means a1=a2a_1 = a_2, which combined with the magnitude pins down both. Don't read it as a1=a2=a3a_1 = a_2 = a_3 — that's three axes, a different constraint.

Summary — formulas & gotchas at a glance

A revision cheat-sheet for the formulas and gotchas above. Click any concept name to jump back to its full explanation.

Formulas (4)

  • Magnitude of a vector and distance between two points

    Magnitude and distance

    v=v12+v22+v32AB=ba|\vec{v}| = \sqrt{v_1^2 + v_2^2 + v_3^2} \qquad AB = |\vec{b} - \vec{a}|
  • Direction Cosines

    Direction-cosine identities

    cos2α+cos2β+cos2γ=1sin2α+sin2β+sin2γ=2\cos^2\alpha + \cos^2\beta + \cos^2\gamma = 1 \qquad \sin^2\alpha + \sin^2\beta + \sin^2\gamma = 2
  • Scalar projection of one vector on another

    Scalar and vector projection

    projba=abbprojba=abb2b\text{proj}_{\vec{b}}\vec{a} = \dfrac{\vec{a}\cdot\vec{b}}{|\vec{b}|} \qquad \overrightarrow{\text{proj}_{\vec{b}}\vec{a}} = \dfrac{\vec{a}\cdot\vec{b}}{|\vec{b}|^2}\,\vec{b}
  • Unit vectors and direction-given construction

    Unit vector and direction construction

    v^=vvv=r(cosαi^+cosβj^+cosγk^)\hat{v} = \dfrac{\vec{v}}{|\vec{v}|} \qquad \vec{v} = r(\cos\alpha\,\hat{i} + \cos\beta\,\hat{j} + \cos\gamma\,\hat{k})

Watch out for (8)

Mastery check — 5 interleaved questions

Try each one before clicking. Questions are interleaved across the concepts above, not grouped — interleaving sharpens transfer.

Example 1VectorsMODERATE
If the position vectors of AA and BB are (21)i^j^(\sqrt{2}-1)\hat{i}-\hat{j} and i^+(2+1)j^\hat{i}+(\sqrt{2}+1)\hat{j} respectively, then what is the magnitude of AB\overrightarrow{AB}?

[Q70 · Sep · 2021]

Example 2VectorsMODERATE
Consider the following for the items that follow: Let a vector a=4i^8j^+k^\vec{a}=4\hat{i}-8\hat{j}+\hat{k} make angles α\alpha, β\beta, γ\gamma with the positive directions of xx, yy, zz axes respectively.
What is cos2β+cos2γ\cos2\beta+\cos2\gamma equal to?

[Q68 · Apr · 2023]

Example 3VectorsEASY
What is the scalar projection of a=i^2j^+k^\vec{a} = \hat{i} - 2\hat{j} + \hat{k} on b=4i^4j^+7k^\vec{b} = 4\hat{i} - 4\hat{j} + 7\hat{k} ?

[Q46 · Sep · 2019]

Example 4VectorsHARD
If a vector of magnitude 2 units makes an angle π3\dfrac{\pi}{3} with 2i^2\hat{i}, π4\dfrac{\pi}{4} with 3j^3\hat{j} and an acute angle θ\theta with 4k^4\hat{k}, then what are the components of the vector?

[Q67 · Apr · 2024]

Example 5VectorsMODERATE
If a=3,b=4|\vec{a}|=3, |\vec{b}|=4 and ab=5|\vec{a}-\vec{b}|=5, then what is the value of a+b|\vec{a}+\vec{b}|?

[Q66 · Sep · 2018]

Drill every past-year question on this subtopic

11 questions from the bank — paginated, with cart and Word-export support.

Related notes