The interactive film is in the book's Companion

Play it, pause it, turn it and drag it with Mathematics for AI and Machine Learning.

Get the book

Projection onto a Line: the Closest Point

Chapter 1 · Mathematics for AI and Machine Learning · Beginner · 1:42

An interactive live film: the projection p = <u,v>/|v|^2 v, the matrix v v^T / v^T v flattening a cloud onto the line, the orthogonal part and Pythagoras. Slide a point along the line to the one closest to u.

Narration

Here are two vectors in space, u in purple and v in blue, and the line through v.

The projection of u onto v is the inner product of u and v, over the squared length of v, times v. It lands at the foot of the perpendicular from u to the line.

The rest of the narration is in the book's Companion.

More from Chapter 1

Interactive1:30Span and Independence: When the Dimension JumpsChapter 1Preview1:31Gram–Schmidt, One Vector at a TimeChapter 1Preview1:42Norms as Cones: the Unit Ball Is a SliceChapter 1Preview1:36The Parallelogram Law: Which Norms Come from an Inner ProductChapter 1Preview1:31The Outer Product: All of Space onto One LineChapter 1Preview1:29Cauchy-Schwarz: a Shadow Is Never Longer than the StickChapter 1Preview1:43Layer Normalization: Project, Then RescaleChapter 1