This sandbox was generated by Claude (Anthropic) for the Linear Algebra 101 course materials, and is built for Module 5 (Orthogonality and Projections). Set two vectors and watch Gram–Schmidt turn them into an orthonormal basis one subtraction at a time; set a vector b and watch its projection onto the span and the orthogonal residual appear; set a handful of points and watch the least-squares line fall out of the normal equations. Every drawn point is computed — each basis vector, the foot of the projection, the residual, the fitted line and every residual bar come from the arithmetic, never sketched.
The residual is what makes it "best". The projection projₛ b is the closest point to b inside the subspace, and the leftover r = b − projₛ b stands perpendicular to every basis vector. Least squares is the same fact applied to the columns of A: x̂ = (AᵀA)⁻¹Aᵀb makes the residual orthogonal to each column, which is exactly the normal equations Aᵀ(b − A x̂) = 0. The page prints those dot products so you can watch them sit at zero.
Notation follows the course: column vectors, m × n = rows × columns, input vectors v₁, v₂, orthonormal basis q₁, q₂, projection projₛ b, residual r, design matrix A, coefficients x̂, fitted line y = c₀ + c₁ x.
What is chosen rather than computed: the default vectors and data points, the preset sets (each labelled where it is selected), and the extent of the drawn grid. Nothing here is a measurement; it is arithmetic, done rather than imitated.
Course demo — linked from the Module 5 lesson deck; the page itself is English‑only for now. Orthonormalize a basis, project a vector onto the span, and fit a line by least squares. One thing to take away: the residual of a projection is always perpendicular to the subspace it was projected onto — and least squares is nothing more than that fact applied to the columns of a matrix.