Mathematics
Vector Projections and Orthogonal Decomposition
Quick fact
When you project vector a onto vector b, the orthogonal remainder (a - projb a) is always perpendicular to b. This simple idea is the foundation of the least squares method, which finds the best-fit line by making the errors exactly orthogonal to the trend.
Why this is interesting
Ever wondered why a shadow looks like it's stretched or squished? That's a vector projection at play—and it's also the secret behind splitting a force into parts that actually affect motion in a certain direction.
Read the full explanation
Understanding Vector Projections and Orthogonal Decomposition
Think of a vector as an arrow pointing in space. Now imagine shining a flashlight perpendicular to a given direction—the shadow of the arrow on that line is the projection. In math, projecting vector a onto vector b gives you a new vector that points exactly along b and has a length equal to the portion of a that 'pushes' in that direction. Why does this matter? Because any vector a can be split into two perpendicular parts: one along b (the projection) and one perpendicular to b (the remainder). This is called orthogonal decomposition, and it's like breaking a diagonal push into a push along the floor and a lift upward. To find the projection, you use the dot product: the scalar projection is (a·b) / |b|, and the vector projection is that scalar times the unit vector in the b direction. The remainder is simply a minus the projection.
A deeper explanation
The mechanism behind projection lies in the dot product's geometric meaning: a·b = |a||b|cosθ, where θ is the angle between the vectors. So (a·b)/|b| gives exactly the length of a's shadow along b. The vector projection is then that scalar times the direction of b. The beauty is that the remainder vector (a - projb a) is always perpendicular to b, which you can verify by dotting it with b: (a - projb a)·b = 0. This orthogonal decomposition is why projections are so powerful: they let you rewrite any vector as a sum of a part that lives in a given subspace (the direction of b) and a part that is completely orthogonal to it. This principle generalizes to higher dimensions and is the engine behind least squares regression—where the best fit is found by making the residual vector perpendicular to the space of all possible predictions. It also underpins how computer graphics render lighting (projecting light vectors onto surfaces) and how GPS works (using projections in coordinate transformations).