๐Ÿ”๏ธ Trigonometry Peaks ยท Trigonometry

Dot Product & Vector Applications

Put vectors to work: the dot product, the angle between two vectors, when they are perpendicular, the projection of one onto another, work done by a force, and the resultant of forces, winds and currents.

In short

  • The dot product turns two arrows into a single number, and it does it two ways that always agree: u . v = u1 v1 + u2 v2 and u . v = |u| |v| cos t.
  • The sign is a free answer: positive means an acute angle, negative an obtuse one, and zero means the two vectors are perpendicular.
  • A projection scales the vector being projected onto: comp_v u = (u . v)/|v| is a number, proj_v u = ((u . v)/|v|2) v is an arrow, and work W = F . d is a projection with a force in it.
  • A resultant is the third side of a tip-to-tail triangle whose interior angle is 180 - t, which is why the resultant formula adds 2 F1 F2 cos t where the law of cosines subtracts.

One multiplication that hands back a number

Loremaster Cos keeps two ropes, a capstan and a weather glass in the Hall of Laws, and says all three ask the same question: how much of this arrow points along that one?

The tool that answers it is the dot product. Given two vectors written in components, it is almost embarrassingly simple: multiply the matching components and add.

u = (3, 4) and v = (5, -2)

u . v = (3)(5) + (4)(-2) = 15 - 8 = 7

Notice what came out. Not an arrow โ€” a number. That is the whole point, and it is why the dot product is sometimes called the scalar product. Adding two vectors gives a vector; dotting two vectors gives a plain number that measures how much they agree.

There is a second formula for exactly the same thing, and it is the one that makes the dot product useful:

u . v = |u| |v| cos t

where t is the angle between the two arrows when they are drawn from the same point.

The two formulas always agree, and the reason is the law of cosines. Draw u and v from one point; the arrow from the tip of v to the tip of u is u - v, and those three arrows form a triangle with t between the two known sides. The law of cosines says

|u - v|2 = |u|2 + |v|2 - 2 |u| |v| cos t

Expand the left-hand side in components and almost everything cancels, leaving 2(u . v) = 2 |u| |v| cos t. So the component recipe and the cosine formula are two faces of one idea: the components are quick to compute, the cosine tells you what the number means.

Two special cases are worth storing away now. A vector dotted with itself gives u . u = |u|2, because the angle between u and itself is 0 and cos 0 = 1 โ€” a handy way to get a squared length with no square root in sight. And the dot product is commutative and distributive, so (2u - v) . w can be expanded exactly as brackets in ordinary algebra, which is why a combination like that is safe to work out either by simplifying first or by expanding first.

The angle, and the right angle

Rearrange the second formula and the angle between any two vectors falls out:

cos t = (u . v) / (|u| |v|)

Three quantities go into that: the dot product on top, and both magnitudes underneath. Then cos-1 turns the ratio into an angle.

u = (4, 3), v = (1, 7)

u . v = 4 + 21 = 25, |u| = 5, |v| = sqrt(50)

cos t = 25 / (5 sqrt(50)) = 0.7071, so t = 45 degrees

Before any calculator comes out, the sign of the dot product already says a great deal, because |u| and |v| are never negative and so the sign belongs entirely to cos t:

  • u . v > 0 means cos t > 0: the angle is acute, the arrows broadly agree.
  • u . v = 0 means cos t = 0: the angle is exactly 90 degrees.
  • u . v < 0 means cos t < 0: the angle is obtuse, the arrows broadly disagree.

The middle line is the most used fact in this whole topic. Two non-zero vectors are perpendicular exactly when their dot product is 0. No protractor, no drawing, no square roots โ€” just one small sum.

That test also solves for an unknown. To find the value of k that makes u = (k, 3) perpendicular to v = (2, -4), set the dot product to zero and solve:

2k - 12 = 0, so k = 6

If k sits in both vectors the equation may turn out to be quadratic, and then two values of k make the arrows perpendicular โ€” one on each side of the origin.

Projection: the shadow one arrow casts on another

Shine a light straight down onto v. The shadow that u casts along v is its projection, and it comes in two flavours.

The scalar projection is how far along v the shadow reaches โ€” a single number, positive or negative:

comp_v u = (u . v) / |v|

The vector projection is that same shadow kept as an arrow, so it points along v:

proj_v u = ((u . v) / |v|2) v

The bracket is one number, and it scales v. That is the quickest way to remember which denominator is which: one factor of |v| turns the dot product into a length, and the second turns v into a direction of length 1. So the scalar projection divides by |v| and the vector projection divides by |v|2.

Keep vector projections exact. With u = (4, 2) and v = (3, 1),

u . v = 14, |v|2 = 10, proj_v u = (14/10)(3, 1) = (21/5, 7/5)

A negative scalar projection is not an error: it means the shadow falls on the far side of the starting point, so u leans away from v.

Work is a projection with a force in it. Only the part of a force that lies along the motion does any work, so

W = F . d = |F| |d| cos t

measured in joules when F is in newtons and d in metres. A rope held at 30 degrees to the ground pulls a sledge with only cos 30 of its strength; the rest of the pull lifts, and lifting does no work if the sledge never rises. A force at 90 degrees to the motion does no work at all, and a force directly opposing the motion โ€” friction โ€” does negative work.

Resultants: two pulls, one triangle

Two tugs pull on a barge. The single force that would do the same job is the resultant, and it is found by laying the two arrows tip to tail: the resultant is the arrow from the very start to the very end.

If the two pulls are at right angles, Pythagoras finishes it โ€” 30 N east and 40 N north give exactly 50 N.

If they meet at some other angle t, the law of cosines does the work, and here is the trap the whole topic hinges on. The angle between the two forces is t, but the angle inside the tip-to-tail triangle is 180 - t, because the second arrow has been swung round to start where the first one ended. Since cos(180 - t) = -cos t, the familiar minus turns into a plus:

|R|2 = F12 + F22 + 2 F1 F2 cos t

A quick check that this is the right way round: at t = 0 the formula gives (F1 + F2)2, which is exactly what two pulls in the same direction should give, and at t = 180 it gives (F1 - F2)2.

For the direction of the resultant, components are easier than any rule. Put F1 along the x-axis; then the second force contributes F2 cos t along and F2 sin t across, so

tan(angle from F1) = (F2 sin t) / (F1 + F2 cos t)

The resultant only sits halfway between the two forces when they are equal in size โ€” otherwise the larger pull drags it towards itself.

A wind and a current

Every navigation question in this skill is a resultant wearing different clothes, because a velocity is a vector and velocities add exactly as forces do.

A boat crossing a river. Point the boat straight across at 4 m/s while the current runs downstream at 3 m/s. The two velocities are perpendicular, so the boat really travels at 5 m/s over the ground. The two motions are also independent, and that is what makes the rest easy: the rowing decides when the boat lands, the current decides where. Across a river 60 m wide the crossing takes 60/4 = 15 s, and in those 15 s the current has carried the boat 3 x 15 = 45 m downstream.

To land directly opposite instead, the boat must be turned upstream far enough that its own upstream component cancels the current. With a boat speed of 5 m/s against a 3 m/s current,

5 sin(angle) = 3, so angle = sin-1(0.6) = 37 degrees upstream

The boat speed is the hypotenuse of that velocity triangle, which is why the ratio is a sine and not a tangent.

A plane in a wind. The plane's nose points one way at its airspeed; the wind blows across that heading; the ground velocity is the sum of the two. So the ground speed comes from the resultant formula above, and the drift angle โ€” how far the actual track lies from the heading โ€” comes from the component version of the direction rule.

The one thing that never works is adding the speeds as plain numbers. A 500 km/h plane meeting an 80 km/h wind does not fly at 580 km/h unless that wind is directly behind it, and it does not fly at 420 km/h unless the wind is directly in front. Everything in between is a triangle.

Worked examples

Example 1

Find the angle between u = (4, 3) and v = (1, 7), to the nearest degree.

  1. The angle formula is cos t = (u . v) / (|u| |v|), so three numbers are needed.
  2. Dot product: u . v = (4)(1) + (3)(7) = 4 + 21 = 25.
  3. Magnitudes: |u| = sqrt(16 + 9) = 5 and |v| = sqrt(1 + 49) = sqrt(50) = 7.0711.
  4. Divide by BOTH: cos t = 25 / (5 x 7.0711) = 25 / 35.355 = 0.7071.
  5. t = cos-1(0.7071) = 45 degrees. (Stopping at 25 would have reported the dot product, not the angle.)

Example 2

For u = (4, 2) and v = (3, 1), find the scalar projection of u onto v to 1 decimal place, and the vector projection exactly.

  1. Both projections start from the same two numbers: u . v = (4)(3) + (2)(1) = 14, and |v|2 = 9 + 1 = 10, so |v| = sqrt(10) = 3.1623.
  2. Scalar projection: comp_v u = (u . v) / |v| = 14 / 3.1623 = 4.4272, which is 4.4 to 1 decimal place.
  3. Vector projection: proj_v u = ((u . v) / |v|2) v = (14/10)(3, 1).
  4. Multiply both components by 14/10 = 7/5: proj_v u = (21/5, 7/5).
  5. Check the shape of the answer: it is a multiple of v, as every projection onto v must be, and its length 14/sqrt(10) agrees with the scalar projection.

Example 3

Two tugs pull on a barge, one with 120 N and one with 80 N, with an angle of 50 degrees between the two pulls. Find the resultant force to 1 decimal place, and the angle it makes with the 120 N pull.

  1. Lay the pulls tip to tail. The angle inside that triangle is 180 - 50 = 130 degrees, so the law of cosines picks up a PLUS sign: |R|2 = 1202 + 802 + 2(120)(80)cos 50.
  2. |R|2 = 14400 + 6400 + 19200 x 0.6428 = 20800 + 12341.5 = 33141.5.
  3. |R| = sqrt(33141.5) = 182.0 N. (Adding the pulls would have given 200 N, which is too big; using minus would have given about 92 N, which is far too small.)
  4. For the direction, take components along the 120 N pull: along = 120 + 80 cos 50 = 171.42, across = 80 sin 50 = 61.28.
  5. tan(angle) = 61.28 / 171.42 = 0.3575, so the angle = 19.7, which is 20 degrees from the 120 N pull โ€” leaning towards it, because it is the larger of the two.

Example 4

A plane points due east with an airspeed of 500 km/h. A wind of 80 km/h blows towards a direction 120 degrees round from east. Find the ground speed to 1 decimal place and the drift angle to the nearest degree.

  1. Ground velocity = air velocity + wind velocity, so this is a resultant with an angle of 120 degrees between the two arrows.
  2. Ground speed squared = 5002 + 802 + 2(500)(80)cos 120 = 250000 + 6400 + 80000 x (-0.5) = 216400.
  3. Ground speed = sqrt(216400) = 465.2 km/h. The negative cosine is doing real work here: the wind is partly holding the plane back, so 465.2 is less than the airspeed.
  4. For the drift, use components. East: 500 + 80 cos 120 = 500 - 40 = 460. North: 80 sin 120 = 69.28.
  5. tan(drift) = 69.28 / 460 = 0.1506, so the drift = 8.6, which is 9 degrees north of the heading.

Practice problems, with solutions

Three problems of increasing difficulty, each with the full working. In the game these are generated fresh every time; these three are fixed so this page always shows the same ones.

Problem 1

Difficulty 1 of 5

u = (6, 2) and v = (6, 4). Work out the dot product u . v. The answer is a single number, not a vector.

Answer: 44

  1. u . v = u1 v1 + u2 v2
  2. u . v = (6)(6) + (2)(4)
  3. u . v = 36 + 8 = 44

Problem 2

Difficulty 3 of 5

u = (3, -5) and v = (1, 3). Find the angle between u and v, to the nearest degree.

Answer: 131 degrees

  1. cos t = (u . v) / (|u| |v|)
  2. u . v = (3)(1) + (-5)(3) = -12
  3. |u| = sqrt(34) = 5.831, |v| = sqrt(10) = 3.1623
  4. cos t = -12 / (5.831 x 3.1623) = -0.6508
  5. t = cos-1(-0.6508) = 130.6ยฐ, which is 131ยฐ to the nearest degree

Problem 3

Difficulty 4 of 5

u = (k, 9) and v = (9, 6). Find the value of k that makes u perpendicular to v. Give an exact answer; a fraction is fine.

Answer: -6

  1. u . v = (k)(9) + (9)(6) = 9k + 54
  2. Perpendicular means u . v = 0, so 9k + 54 = 0
  3. 9k = -54
  4. k = -54 / 9 = -6

Common mistakes

  • Leaving the dot product as a vector, writing (u1 v1, u2 v2) instead of adding the two products into the single number the dot product always is.
  • Dividing by only one magnitude when finding an angle, which can produce a "cosine" bigger than 1 and no angle at all.
  • Dividing by |v| instead of |v|2 in the vector projection, which gives an arrow along v of the wrong length.
  • Putting the angle between two forces straight into the ordinary law of cosines, when the angle inside the tip-to-tail triangle is 180 minus it โ€” so the formula adds rather than subtracts.
  • Adding a current or a wind to a speed as a plain number, when only a velocity added as a vector can answer the question.

What you should be able to do

  • Compute the dot product of two vectors and use it to find the angle between them.
  • Decide whether two vectors are orthogonal, and find the value that makes them so.
  • Find the projection of one vector onto another, and the work done by a force along a displacement.
  • Find the magnitude and direction of a resultant force or velocity, including a plane in a wind and a boat in a current.

Where this fits in the curriculum

Common Core

  • HSN-VM.A.3

    High school โ€” Solve problems involving velocity and other quantities that can be represented by vectors.

    HSN-VM.A.3 is a (+) standard โ€” beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II.

  • HSN-VM.B.4.B

    High school โ€” Given two vectors in magnitude and direction form, determine the magnitude and direction of their sum.

    HSN-VM.B.4.B is a (+) standard โ€” beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II.

  • HSG-SRT.D.11

    High school โ€” Understand and apply the Law of Sines and the Law of Cosines to find unknown measurements in right and non-right triangles (e.g. surveying problems, resultant forces).

    HSG-SRT.D.11 is a (+) standard โ€” beyond the college- and career-ready threshold, i.e. precalculus rather than Geometry. The dot product itself has no Common Core code; this skill is tagged by the resultant-force and velocity standards that do exist.

Learn these first