Calculator Input
Enter the basis matrix by rows. The matrix columns define the subspace basis vectors.
Example Data Table
| Example | Basis Matrix A | Target Vector y | Coefficients c | Projection p | Residual r |
|---|---|---|---|---|---|
| Projection onto a two-vector subspace in R³ | [1 0; 1 1; 0 1] | [2, 1, 2] | [1, 1] | [1, 2, 1] | [1, -1, 1] |
Formula Used
For a full-column-rank basis matrix A, the orthogonal projection matrix is P = A(AᵀA)⁻¹Aᵀ.
The normal-equation solution is c = (AᵀA)⁻¹Aᵀy. These coefficients reconstruct the projected vector inside the chosen subspace.
The projected vector is p = Ac. The residual is r = y - p. A valid orthogonal projection satisfies Aᵀr = 0.
The shortest distance from y to the subspace equals ‖r‖. The calculator also reports norms and explained energy share.
How to Use This Calculator
- Enter the basis matrix by rows. Each column should represent one basis vector of the target subspace.
- Enter the target vector using the same ambient dimension as the number of matrix rows.
- Add optional component labels for clearer charts and output tables.
- Choose decimal precision, graph mode, and whether detailed matrices should be shown.
- Press Calculate Projection to display the results above the form and below the header.
- Use the CSV and PDF buttons to export the current result set.
FAQs
1. What does this calculator project onto?
It projects the target vector onto the column space of the input matrix. Each matrix column acts as a basis vector for the destination subspace.
2. Why must the target vector length match the matrix rows?
Both objects must live in the same ambient space. If the matrix has three rows, the target vector must have three components.
3. What happens if the basis columns are dependent?
The Gram matrix becomes singular, so the standard inverse-based formula fails. This page warns you when the entered columns are not independent.
4. What does the coefficient vector mean?
The coefficient vector shows how much of each basis column is used to build the orthogonal projection inside the selected subspace.
5. Why is the residual important?
The residual measures the part of the target vector outside the subspace. Its norm gives the shortest distance to that subspace.
6. What does the orthogonality test show?
It evaluates Aᵀr. For an exact orthogonal projection, this vector should be zero or numerically very close to zero.
7. Can this handle dimensions above three?
Yes. The calculations work for higher dimensions. When geometry becomes hard to draw directly, the chart switches to component comparison.
8. What do the export buttons include?
CSV export includes the summary, vectors, coefficients, and key matrices. PDF export creates a compact report of the same result set.