Turn vectors into clear components using Hilbert ideas. Pick weights, see matrices, confirm orthogonality fast. Use this tool to learn, verify, and share outputs.
Enter a vector x and a basis for a subspace. The tool returns the orthogonal projection, distance, and diagnostics.
This example uses the default values shown in the form.
| n | k | x | v₁ | v₂ | Inner product | Projection p | Distance ||x−p|| |
|---|---|---|---|---|---|---|---|
| 3 | 2 | [2, 1, -1] | [1, 0, 1] | [0, 1, 1] | Standard | [0.666667, -0.333333, 0.333333] | 2.309401 |
This calculator applies the Hilbert Projection Theorem in a finite-dimensional inner-product space. Given a subspace S = span{v₁,…,vₖ} and a vector x, there is a unique p ∈ S minimizing the distance ||x−p||, and the remainder r = x−p is orthogonal to S.
With an inner product ⟨u,v⟩ = uᵀWv (standard, diagonal weights, or custom matrix), set B = [v₁ … vₖ]. The coefficients c satisfy the normal equations:
(BᵀWB)c = BᵀWx, and p = Bc, r = x − p.
The tool also checks max|⟨r,vᵢ⟩| and the Pythagorean identity ||x||² ≈ ||p||² + ||r||².
It computes the orthogonal projection of a vector onto a subspace, plus the orthogonal remainder and distance. It is a numeric form of the Hilbert Projection Theorem in finite dimensions.
It defines ⟨u,v⟩ = uᵀWv. With W symmetric positive definite, it behaves like a weighted geometry. Distances and orthogonality are measured using that W, not the usual dot product.
If your basis vectors are linearly dependent, or if W does not define a valid inner product, then G = BᵀWB may be singular. Remove dependent vectors, or switch to a better-conditioned basis.
For a correct projection, r = x − p should satisfy ⟨r, vᵢ⟩ ≈ 0 for all basis vectors. The tool reports the maximum absolute value, so smaller is better.
Use it when the basis is nearly dependent or badly scaled. Orthonormal vectors improve numerical stability and make it easier to interpret coefficients, especially under a weighted inner product.
cond₁(G) roughly measures sensitivity to rounding and input noise. Large values suggest that small changes in inputs can cause noticeable coefficient changes. Consider rescaling vectors or orthonormalizing.
No. Computations use floating-point arithmetic and may show small residuals. Increase precision, try orthonormalization, or use a better-conditioned basis to reduce visible error.
Yes. After running a calculation, use the CSV and PDF buttons to download a compact report containing the key inputs and outputs. Run a new calculation to update the export.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.