the projection of one vector on another
Stand a stick upright in sunlight and it casts a shadow on the ground; the shadow is the part of the stick that lies along the ground's direction. Projecting one vector onto another is the same idea: given vectors a and b, the projection of a onto b is the 'shadow' of a in b's direction — how much of a runs the same way as b. It answers questions like 'how much of this push acts along the ramp?'
There are two outputs, and it helps to keep them straight. The scalar projection (or component of a along b) is a single signed number: comp_b a = (a . b) / |b| = |a| cos theta, where theta is the angle between them. It is positive when a leans toward b, negative when a leans away. The vector projection is that length carried in b's actual direction — multiply the scalar projection by the unit vector b-hat: proj_b a = ((a . b) / |b|^2) b. Notice |b| in the scalar version and |b|^2 in the vector version; the extra |b| comes from converting to the unit vector b-hat = b / |b|. A neat by-product: a splits cleanly into a part along b and a part perpendicular to b, namely a = proj_b a + (a - proj_b a), where the second piece is orthogonal to b.
Projection is the engine behind 'resolving' a vector into useful directions — decomposing a force into components along and across an inclined plane, or finding the closest point on a line to a given point. It is built entirely from the dot product, so it inherits the dot product's sensitivity to angle. The classic mistake is to forget that direction matters: projecting a onto b and projecting b onto a give different answers in general, because each measures shadow length in a different direction. Read 'project a onto b' carefully — the second vector names the direction you are casting onto.
Project a = (4, 3, 0) onto b = (1, 0, 0). Here a . b = 4 and |b| = 1, so the scalar projection is 4 and the vector projection is proj_b a = (4/1) (1, 0, 0) = (4, 0, 0) — exactly the part of a lying along the x-axis. The leftover (0, 3, 0) is perpendicular to b, confirming a = (4, 0, 0) + (0, 3, 0).
The shadow of a in b's direction; the remainder is perpendicular.
Distinguish the scalar projection (a number, can be negative) from the vector projection (a vector). And 'a onto b' is not 'b onto a' — projection is not symmetric.