Steply

Project (2, 2, 1, 1) onto (1, 1, 1, 1)

Step by step, with the reason for every step · Projection onto a vector · Linear Algebra

Step by step

The question

Question: find the projection of (2, 2, 1, 1) onto (1, 1, 1, 1).

v = [2; 2; 1; 1], s = [1; 1; 1; 1]

The projection of v onto s is the part of v that goes along s.

Think of the shadow of v on the line through s, with the light straight above.

projection: the part of v along s
like the shadow of v on the line of s

1 Write the rule

The rule: v dot s, over s dot s, times s.

The fraction is one number: how much of s we need.

proj = v • ss • s × s

2 Work out the number

The top: v • s, matching entries multiplied and added.

v • s = 2 × 1 + 2 × 1 + 1 × 1 + 1 × 1 = 2 + 2 + 1 + 1 = 6

The bottom: s • s.

s • s = 1 × 1 + 1 × 1 + 1 × 1 + 1 × 1 = 1 + 1 + 1 + 1 = 4

So the number is 6/4, made simpler: 3/2.

number = 64 = 32

Careful!

The bottom is s dot s, the vector we project onto.

Not v dot v.

Careful: the bottom is s • s, not v • v

3 Times s

Times s: every entry times 3/2.

So the projection is (3/2, 3/2, 3/2, 3/2).

proj = 32 × [1; 1; 1; 1] = [3 over 2; 3 over 2; 3 over 2; 3 over 2]

4 Check

Let's check: the leftover, v minus the projection, must be at a right angle to s.

v − proj = [2; 2; 1; 1] − [3 over 2; 3 over 2; 3 over 2; 3 over 2]
v − proj = [2 − 3 over 2; 2 − 3 over 2; 1 − 3 over 2; 1 − 3 over 2]
v − proj = [1 over 2; 1 over 2; −1 over 2; −1 over 2]

Its dot product with s is 0.

So the leftover is at a right angle to s: the answer is right!

(v − proj) • s = 12 × 1 + 12 × 1 + (−12) × 1 + (−12) × 1 = 12 + 12 − 12 − 12 = 0

Let's look back.

First: write the rule.

Then: work out the number.

Then: times s.

Last: check.

Answer
proj = 32 × [1; 1; 1; 1] = [3 over 2; 3 over 2; 3 over 2; 3 over 2]

Your turn

Try this one yourself, then check:

Project [1; 2; 3; 1] onto [1; 1; 1; 1]
Show the answer
[7 over 4; 7 over 4; 7 over 4; 7 over 4]

More from Projection onto a vector

The whole lesson: Projection onto a vector →