BIZNIQUE / LINEAR ALGEBRA / 36
Remove a component before normalising
Remove a component before normalising
Follow the geometric step behind Gram–Schmidt.
BIZNIQUE / LINEAR ALGEBRA / 36
Follow the geometric step behind Gram–Schmidt.
THE IDEA
Subtracting the projection of v onto nonzero u leaves a component orthogonal to u. If that remainder is nonzero, dividing by its norm produces the next unit direction. The demo rotates the direction used for projection.
v⊥ = v − (uᵀv / uᵀu)u
An exactly zero remainder signals linear dependence. In floating-point work, nearly dependent vectors need numerical care; classical Gram–Schmidt is not always the most stable implementation.
TRY IT YOURSELF
Orthogonalise v = (1, 2) against u = (1, 0).
Subtract (1, 0), leaving (0, 2). Normalising gives (0, 1).