Gram-Schmidt orthogonalization in 2D
What you are seeing: two input vectors and the orthonormal output produced by one step of Gram-Schmidt: , then . The dashed cyan vector shows the projection being subtracted; the orange vector is the residual that becomes after normalization.
Drag the sliders for the angles and magnitudes of and . The readout reports , which stays at machine zero () regardless of input. Pushing collinear with collapses the residual to zero (linearly dependent inputs), which the readout flags.
v1 angle20
v1 length2.00
v2 angle70
v2 length2.00
|u_1 . u_2|:0
|v_2 - proj|:0
00WHAT TO TRY
- Vary each control and watch the rail readouts respond.
- Compare the diagnostic plot against the live scene.