Vectors and Components

Break a vector into components, and its arithmetic becomes ordinary arithmetic.

Before this Lesson

A 12 m mast stands on level ground, held by two guy cables running from its top down to anchor bolts. How long is each cable? What angle does one make with the mast? What angle do the two make with each other, in a triangle tilted at a slant to everything you could draw? Write each cable as three numbers, and those questions all turn into arithmetic you could do on a napkin.

x y z Q (0, 0, 12) P (3, −4, 0) S (−5, 0, 0)
A mast and two guy cables, with coordinates in meters

An arrow is a list of numbers

A vector is a quantity with a size and a direction: a 5 kN pull toward an anchor, a 20 ft walk up a ramp. It gets a bold letter, A\mathbf{A}, and its size gets bars, ∣A∣|\mathbf{A}|, a plain number that's never negative.

Start with a flat one. An arrow of length ∣A∣|\mathbf{A}| points at an angle θ\theta above the x-axis. You could reach its tip another way: walk along the x-axis, then straight up. Those two legs are the arrow's components, axa_x and aya_y, and since the arrow is the hypotenuse of a right triangle, the ratios from Triangle Trigonometry give them directly:

ax=∣A∣cos⁡θay=∣A∣sin⁡θa_x = |\mathbf{A}|\cos\theta \qquad a_y = |\mathbf{A}|\sin\theta
x y θ A ax = |A| cos θ ay = |A| sin θ
A vector and its two components

A 10 kN pull at 30° is 8.66 kN across and 5 kN up. Those two numbers say everything the arrow says. Measure θ\theta counterclockwise from the +x axis, and the signs come out on their own: at 135°, the cosine is negative and so is axa_x, because the arrow points backward along x.

Three dimensions add one more leg. Let i\mathbf{i}, j\mathbf{j}, and k\mathbf{k} be arrows of length 1 along the x, y, and z axes. Any vector is then a recipe: axa_x steps along i\mathbf{i}, aya_y along j\mathbf{j}, and aza_z along k\mathbf{k}. The Handbook's Vectors section opens with this form:

A=axi+ayj+azk\mathbf{A} = a_x\mathbf{i} + a_y\mathbf{j} + a_z\mathbf{k}

Those three steps trace the edges of a box, and the arrow is the box's long diagonal. The Pythagorean theorem across the floor gives the floor's diagonal. That diagonal and the height aza_z then form a second right triangle, with the arrow as its hypotenuse. Run the theorem twice, and the inner square root cancels, leaving what the Handbook prints as the Length of Vector A:

∣A∣=ax2+ay2+az2|\mathbf{A}| = \sqrt{a_x^2 + a_y^2 + a_z^2}
x y z i j k ax ay az √(ax2 + ay2) A
The vector is the long diagonal of a box

Squaring removes a negative component's sign, as long as you type (−3)2(-3)^2 and not −32-3^2.

Unit vectors: direction with the size divided out

A cable can only pull along its own length, so to describe that pull you need the cable's direction with its size divided out. Divide a vector by its own length, and every component scales by the same factor. The arrow keeps its direction and ends up exactly 1 long. That's a unit vector, and the Handbook prints no formula for it because it's one division:

u=A∣A∣=ax∣A∣i+ay∣A∣j+az∣A∣k\mathbf{u} = \frac{\mathbf{A}}{|\mathbf{A}|} = \frac{a_x}{|\mathbf{A}|}\mathbf{i} + \frac{a_y}{|\mathbf{A}|}\mathbf{j} + \frac{a_z}{|\mathbf{A}|}\mathbf{k}

Exam problems often give two points instead of a vector. To travel from PP to QQ, x has to change by xQ−xPx_Q - x_P, and likewise y and z. So the arrow from PP to QQ is head minus tail:

rPQ=(xQ−xP)i+(yQ−yP)j+(zQ−zP)k\mathbf{r}_{PQ} = (x_Q - x_P)\mathbf{i} + (y_Q - y_P)\mathbf{j} + (z_Q - z_P)\mathbf{k}

Subtract in the other order, and you get the same arrow running backward. "From" names the tail, and "to" names the head.

Worked Example The length and direction of a cable
1 of 3

One cable runs between anchor P(3,−4,0)P(3, -4, 0) m and the mast top Q(0,0,12)Q(0, 0, 12) m. Find its length and the unit vector pointing from PP to QQ.

Direction cosines: the unit vector under another name

You can also say which way an arrow points with angles. Its direction angles, α\alpha, β\beta, and γ\gamma, are the angles it makes with the +x, +y, and +z axes. Drop a perpendicular from the arrow's tip to any axis, and you get a right triangle with the arrow as its hypotenuse and the component as the side next to the angle. So each cosine is a component over the length, as the Handbook's Vectors section prints under Direction Cosines of A:

cos⁡α=ax∣A∣cos⁡β=ay∣A∣cos⁡γ=az∣A∣\cos\alpha = \frac{a_x}{|\mathbf{A}|} \qquad \cos\beta = \frac{a_y}{|\mathbf{A}|} \qquad \cos\gamma = \frac{a_z}{|\mathbf{A}|}
x y z A α β γ x A α ax cos α = ax / |A| y A β ay cos β = ay / |A| z A γ az cos γ = az / |A|
One right triangle for each axis
At left, the three angles in space. At right, each one's triangle laid flat, so its right angle looks like one.

Those fractions are the components of the unit vector, so direction cosines are a new name for a calculation you've already done. And since a unit vector has length 1, the Handbook gives you a built-in check, which also finds a third angle from the other two:

cos⁡2α+cos⁡2β+cos⁡2γ=1\cos^2\alpha + \cos^2\beta + \cos^2\gamma = 1

The cable's unit vector hands over its angles directly. From cos⁡γ=12/13\cos\gamma = 12/13, γ=22.6∘\gamma = 22.6^\circ, which is the cable's angle off the vertical mast. From cos⁡β=4/13\cos\beta = 4/13, β=72.1∘\beta = 72.1^\circ. From cos⁡α=−3/13\cos\alpha = -3/13, α=103.3∘\alpha = 103.3^\circ: a negative cosine means an angle past 90°, because the cable runs backward along x.

Checkpoint
1 of 3

What are the direction cosines, cos⁡α\cos\alpha, cos⁡β\cos\beta, and cos⁡γ\cos\gamma, of A=8i−4j+k\mathbf{A} = 8\mathbf{i} - 4\mathbf{j} + \mathbf{k}?

A.
1.6, −0.8, 0.21.6,\ -0.8,\ 0.2
B.
0.889, 0.444, 0.1110.889,\ 0.444,\ 0.111
C.
0.889, −0.444, 0.1110.889,\ -0.444,\ 0.111
D.
0.615, −0.308, 0.0770.615,\ -0.308,\ 0.077

Sums and differences: one column at a time

Walk along A\mathbf{A}, then along B\mathbf{B}, with the second arrow starting at the first one's tip. Your total trip in x is the x of one plus the x of the other, and nothing that happens in y can change it. So stack the vectors, i\mathbf{i} over i\mathbf{i}, j\mathbf{j} over j\mathbf{j}, k\mathbf{k} over k\mathbf{k}, and each column adds on its own. Subtracting works the same way, and the Handbook's Vectors section prints both:

A±B=(ax±bx)i+(ay±by)j+(az±bz)k\mathbf{A} \pm \mathbf{B} = (a_x \pm b_x)\mathbf{i} + (a_y \pm b_y)\mathbf{j} + (a_z \pm b_z)\mathbf{k}
0 1 2 3 4 5 6 7 0 1 2 3 4 5 x y A + B A = 4i + j B = 2i + 3j A + B = 6i + 4j 0 1 2 3 4 5 6 7 0 1 2 3 4 5 x y A − B A = 4i + j B = 2i + 3j A − B = 2i − 2j
Sum and difference on the same grid

In the figure, A=4i+j\mathbf{A} = 4\mathbf{i} + \mathbf{j} and B=2i+3j\mathbf{B} = 2\mathbf{i} + 3\mathbf{j} add to 6i+4j6\mathbf{i} + 4\mathbf{j}. Their lengths don't add: 4.12 and 3.61 total 7.73, but the sum is only 7.21 long. Lengths add only when the arrows point the same way. The difference, 2i−2j2\mathbf{i} - 2\mathbf{j}, is the arrow from B\mathbf{B}'s tip to A\mathbf{A}'s tip, which is head minus tail again.

Checkpoint
1 of 3

For A=3i−2j+4k\mathbf{A} = 3\mathbf{i} - 2\mathbf{j} + 4\mathbf{k} and B=−i+5j+2k\mathbf{B} = -\mathbf{i} + 5\mathbf{j} + 2\mathbf{k}, what is the magnitude of A+B\mathbf{A} + \mathbf{B}?

The dot product: how much two vectors agree

Two people haul a crate with ropes. Pulling the same way, their efforts fully add. At right angles, neither helps or hinders the other. In opposite directions, they fight. The dot product puts a number on that agreement:

A⋅B=∣A∣∣B∣cos⁡θ\mathbf{A} \cdot \mathbf{B} = |\mathbf{A}||\mathbf{B}|\cos\theta

Here θ\theta is the angle between the two arrows, placed tail to tail. The result is positive when they lean together, zero at right angles, and negative when they oppose. It's a single number with no direction, which is why the Handbook calls it a scalar product.

θ A B θ = 40° A · B > 0 θ A B θ = 90° A · B = 0 θ A B θ = 130° A · B < 0
The sign of the dot product follows the angle
The highlighted segment is how far A\mathbf{A} leans along B\mathbf{B}: forward at 40°, not at all at 90°, backward at 130°.

Problems usually give components, not an angle, and here's the pleasant surprise: you don't need the angle. Two axis arrows that match have i⋅i=(1)(1)cos⁡0∘=1\mathbf{i} \cdot \mathbf{i} = (1)(1)\cos 0^\circ = 1. Two that differ have i⋅j=(1)(1)cos⁡90∘=0\mathbf{i} \cdot \mathbf{j} = (1)(1)\cos 90^\circ = 0. So multiply out (axi+ayj+azk)⋅(bxi+byj+bzk)(a_x\mathbf{i} + a_y\mathbf{j} + a_z\mathbf{k}) \cdot (b_x\mathbf{i} + b_y\mathbf{j} + b_z\mathbf{k}), all nine products, and the six mixed ones vanish. Only like with like survives. The Handbook's Vectors section prints the whole chain on one line, including the fact that order doesn't matter:

A⋅B=axbx+ayby+azbz=∣A∣∣B∣cos⁡θ=B⋅A\mathbf{A} \cdot \mathbf{B} = a_x b_x + a_y b_y + a_z b_z = |\mathbf{A}||\mathbf{B}|\cos\theta = \mathbf{B} \cdot \mathbf{A}

Those two forms are the same number, so setting them equal gives the angle between any two vectors. The Handbook leaves this rearrangement to you:

cos⁡θ=A⋅B∣A∣∣B∣\cos\theta = \frac{\mathbf{A} \cdot \mathbf{B}}{|\mathbf{A}||\mathbf{B}|}

Let the sign ride. A negative dot product gives a negative cosine, and arccosine returns the obtuse angle by itself, as it did in the law of cosines. Many approved calculators also take dot products in a vector mode, which makes a quick check on your arithmetic.

Worked Example The angle between the two cables
1 of 3

Both cables leave the mast top Q(0,0,12)Q(0, 0, 12) m, one to anchor P(3,−4,0)P(3, -4, 0) m and one to anchor S(−5,0,0)S(-5, 0, 0) m. Find the angle between them.

x y z Q (0, 0, 12) P (3, −4, 0) S (−5, 0, 0)
The mast and its two cables

Zero means perpendicular

At 90° the cosine is zero, so perpendicular vectors have a dot product of zero, whatever their sizes. It runs in reverse too. The Handbook's Identities list says that if A⋅B=0\mathbf{A} \cdot \mathbf{B} = 0, then A=0\mathbf{A} = 0, B=0\mathbf{B} = 0, or A\mathbf{A} is perpendicular to B\mathbf{B}.

That makes a test with no angles and no square roots: multiply the columns and add. You can't judge by eye, because only the total matters, and a zero in one column proves nothing. An unknown component works the same way. Write the dot product with the unknown in it, set it to zero, and solve.

Checkpoint
1 of 2

Which of these are perpendicular to A=2i−3j+k\mathbf{A} = 2\mathbf{i} - 3\mathbf{j} + \mathbf{k}?

A.
3i+2j3\mathbf{i} + 2\mathbf{j}
B.
−2i+3j−k-2\mathbf{i} + 3\mathbf{j} - \mathbf{k}
C.
2i+3j+k2\mathbf{i} + 3\mathbf{j} + \mathbf{k}
D.
i+j+k\mathbf{i} + \mathbf{j} + \mathbf{k}

Projection: the shadow of one vector on another

Hold a stick at a slant with the sun straight overhead. Its shadow on the ground is shorter than the stick, because the shadow is only the part of the stick that runs along the ground. Projecting A\mathbf{A} onto B\mathbf{B} is the same thing, with the line of B\mathbf{B} as the ground. The shadow's length, ∣A∣cos⁡θ|\mathbf{A}|\cos\theta, is the scalar projection.

θ A B |A| cos θ = A · B / |B|
The shadow of A on the line of B

You want that from components, and the dot product ∣A∣∣B∣cos⁡θ|\mathbf{A}||\mathbf{B}|\cos\theta has it, with one extra factor of ∣B∣|\mathbf{B}|. Divide that out:

scalar projection of A onto B=A⋅B∣B∣\text{scalar projection of } \mathbf{A} \text{ onto } \mathbf{B} = \frac{\mathbf{A} \cdot \mathbf{B}}{|\mathbf{B}|}

The ground only supplies a direction: make B\mathbf{B} twice as long, and the shadow of A\mathbf{A} doesn't change. So you divide by the magnitude of the vector after the word "onto." The Handbook has this in words only, saying the dot product represents the projection of B\mathbf{B} onto A\mathbf{A} times ∣A∣|\mathbf{A}|, with the letters the other way around. A negative result means the shadow falls behind the tail of B\mathbf{B}.

To make the shadow a vector, give it a direction by multiplying by the unit vector of B\mathbf{B}:

vector projection of A onto B=A⋅B∣B∣⋅B∣B∣=A⋅B∣B∣2 B\text{vector projection of } \mathbf{A} \text{ onto } \mathbf{B} = \frac{\mathbf{A} \cdot \mathbf{B}}{|\mathbf{B}|} \cdot \frac{\mathbf{B}}{|\mathbf{B}|} = \frac{\mathbf{A} \cdot \mathbf{B}}{|\mathbf{B}|^2}\,\mathbf{B}
Worked Example Both projections of one vector
1 of 3

For A=2i+3j+6k\mathbf{A} = 2\mathbf{i} + 3\mathbf{j} + 6\mathbf{k} and B=3i+4k\mathbf{B} = 3\mathbf{i} + 4\mathbf{k}, find the scalar and vector projections of A\mathbf{A} onto B\mathbf{B}.

Work: only the force along the path counts

Drag a sled with a rope angled upward. Part of your pull moves the sled forward, and part just lightens it. Only the forward part does work. Carry a bucket across a level yard, and your upward lift does no work on it at all, as far as physics is concerned. Your arm may disagree.

d θ F |F| sin θ (does none) |F| cos θ (does work)
Only part of the pull lies along the path

So work is the force's projection on the path, times the length of the path, and that product is a dot product. A force against the motion gives negative work, and a force perpendicular to it gives none:

U=F⋅d=Fxdx+Fydy+FzdzU = \mathbf{F} \cdot \mathbf{d} = F_x d_x + F_y d_y + F_z d_z

The Handbook keeps work in its Dynamics section, under Principle of Work and Energy. It calls work UU, saving WW for weight, and writes the constant-force case as UF=(Fccos⁡θ)ΔsU_F = (F_c\cos\theta)\Delta s, the same thing with the angle showing. Newtons times meters give joules, and pounds times feet give ft-lb.

Checkpoint
1 of 2

A constant force F=20i+10j−5k\mathbf{F} = 20\mathbf{i} + 10\mathbf{j} - 5\mathbf{k} N acts over a displacement d=3i−2j+4k\mathbf{d} = 3\mathbf{i} - 2\mathbf{j} + 4\mathbf{k} m. How much work does it do?

J

Recap

  • In component form, ∣A∣|\mathbf{A}| is the Pythagorean theorem, and sums and differences go one column at a time.
  • A unit vector is A/∣A∣\mathbf{A}/|\mathbf{A}|. Along a line, take head minus tail first. Its components are the direction cosines, whose squares add to 1.
  • A⋅B=axbx+ayby+azbz=∣A∣∣B∣cos⁡θ\mathbf{A} \cdot \mathbf{B} = a_x b_x + a_y b_y + a_z b_z = |\mathbf{A}||\mathbf{B}|\cos\theta. A negative result means an obtuse angle, and zero means perpendicular.
  • The scalar projection of A\mathbf{A} onto B\mathbf{B} is A⋅B/∣B∣\mathbf{A} \cdot \mathbf{B}/|\mathbf{B}|. Multiply by the unit vector of B\mathbf{B} for the vector projection.
  • The work of a constant force is F⋅d\mathbf{F} \cdot \mathbf{d}, with d\mathbf{d} running from start to finish.