Visual walkthrough — Projection of vectors
Step 0 — Two arrows and a floor
Before any formula, we need to agree on what we are even looking at.
An arrow (a vector) is just a length pointing in a direction. We draw two of them starting from the same point :
- — the arrow we want to take the shadow of.
- — the arrow we shine the shadow onto. Think of as marking out a floor-direction, a line to drop shadows onto.
The little symbol over a letter just means "this is an arrow, not a plain number".

Step 1 — Drop the shadow: a right triangle appears
WHAT. Shine light straight down onto the line through . The tip of lands somewhere on that line. The segment from to that landing point is the shadow. Call its signed length .
WHY. "Straight down" means the light rays hit the floor at . That perpendicular drop is the only rule that makes a clean triangle — and a right triangle is a shape whose sides we know how to relate.
PICTURE. Look at the red dashed line dropping from 's tip: it meets 's line at a perfect right angle (the small square). That gives us a right triangle:
- the slanted side (hypotenuse) is itself, with length ;
- the base lying along is the shadow, length ;
- the angle at between and we call (the Greek letter "theta", just a name for that opening angle).

The vertical bars mean length of — a plain positive number, like measuring the arrow with a ruler.
Step 2 — Why , and nothing else, gives the shadow
WHAT. In our right triangle, the shadow is the side next to the angle (the adjacent side), and is the hypotenuse. We claim
WHY this tool? We need a machine that eats the angle and the hypotenuse and spits out the adjacent side. That machine is cosine. By its very definition on a right triangle: We did not pick sine (that gives the opposite side, the height of the shadow above the floor — the part we are throwing away) and not tangent (a ratio of the two sides that ignores the hypotenuse's actual length). Cosine is the unique fit: it measures how much of the hypotenuse survives the lean onto the floor.
PICTURE. As grows from , the arrow leans further from the floor and the green shadow shrinks — exactly what does (it falls from toward ). At the arrow points straight up, the shadow vanishes, and . Perfect match.

Multiplying: . Here is the arrow's full length and is the fraction of that length that lies along .
Step 3 — The sign of the shadow: cover the back-side case
WHAT. What if is bigger than — leans away from ? Then the landing point is on the opposite side of , and we say the shadow length is negative.
WHY. is positive for , exactly zero at , and negative for . So automatically turns negative. This is a feature, not a bug: the minus sign records which side of the shadow fell on.
PICTURE. Three cases side by side:
- (blue): shadow points forward along , .
- : is perpendicular, shadow has zero length, .
- (red): shadow points backward, .

Step 4 — Escape the protractor with the dot product
WHAT. The formula is honest but useless with only coordinates: nobody hands you . We swap it out using the dot product.
WHY this tool? The Dot product is defined by two facts that are secretly the same: The right-hand side already contains the we want, glued to the two lengths. So the dot product is the one tool that hides an angle inside pure arithmetic — it lets us compute 's effect without ever measuring the angle.
PICTURE. The dot product bar: coordinates go in the left slot, the geometric meaning comes out the right slot — the same number by two routes.

Now isolate the shadow. We want alone, so divide both sides of by : Every symbol: is the multiply-and-add number, is the length of we divide out because the dot product carried an extra factor of we never asked for.
Step 5 — From a length to an arrow
WHAT. So far is just a number. The vector projection is an actual arrow: it has that length and points along .
WHY. Any vector is (how long) × (which way). We have the length . The "which way" is the unit vector — the direction of stripped of its length. Attaching them:
Watch the denominator: one came from getting the length in Step 4, the second came from turning into a unit direction. Together (since ).
PICTURE. The green arrow is the finished vector projection, sitting on 's line with length , and itself scaled to unit length shown underneath.

Step 6 — The leftover piece must be perpendicular
WHAT. Subtract the shadow-arrow from . What remains is the part of that had no direction along :
WHY. By construction the projection soaked up all the along- content of . Whatever is left can only point at right angles to . Let us prove it — take the dot product of the leftover with : A dot product of zero means the two arrows meet at . So . ✓
PICTURE. (orange) is now the exact sum of two perpendicular arrows: the green shadow along plus the red perpendicular remainder. They form a right triangle whose hypotenuse is — the same triangle from Step 1, now labelled with vectors.

This split is Orthogonal decomposition, the engine behind Gram-Schmidt process and Least squares regression.
Step 7 — The degenerate case: what if ?
WHAT. If is the zero vector (a point, no direction), then and the formula asks us to divide by zero.
WHY it must break. A shadow needs a direction to fall along. The zero vector points nowhere, so "the shadow of onto nothing" has no meaning — the maths correctly refuses (division by zero) rather than inventing a fake answer.
PICTURE. collapsed to the origin: there is no line to drop a shadow onto, and the projection is undefined.

The one-picture summary
Everything on one canvas: the right triangle (Step 1–2), the dot product replacing the angle (Step 4), the green shadow-arrow (Step 5), and the red perpendicular leftover (Step 6).

Recall Feynman: tell the whole story in plain words
Stand two sticks in the ground from the same spot. Shine a torch straight down onto the line of the second stick, . The first stick, , throws a flat shadow along that line — that shadow's length is the projection.
To measure it we notice a right triangle: the stick is the slanted side, the shadow is the bottom side. Cosine of the lean-angle turns the stick's length into the shadow's length. But nobody wants to measure angles, so we use the dot product — a quick "multiply the matching parts and add them up" trick that secretly already knows the cosine. Divide by the length of to peel off the extra bit, and we have the shadow as a plain number.
To make it an arrow, we glue that number onto the unit-direction of — which needs a second divide by , hence underneath. Subtract this shadow-arrow from the original stick and what is left points straight up off the floor — perpendicular to , guaranteed. If is a mere point with no direction, there is no floor to cast onto, and the whole idea (rightly) has no answer.
Active recall
Which trig ratio turns into the shadow length, and why?
Why do we use the dot product instead of measuring ?
Where do the two 's in the vector projection come from?
Prove is perpendicular to .
What happens to the projection when ?
What does a negative scalar projection mean geometrically?
Connections
- Projection of vectors — the parent topic this walkthrough derives.
- Dot product — the multiply-and-add engine that eliminates .
- Unit vectors — supplies the direction in Step 5.
- Orthogonal decomposition — the parallel + perpendicular split of Step 6.
- Gram-Schmidt process — repeated projection to orthonormalise.
- Least squares regression — projecting data onto a subspace.
- Work done by a force — uses the projection of force along displacement.