Skip to content

Gram-Schmidt 3D without normalization

This is the variant of the Gram-Schmidt process that stops at orthogonalization: starting from three vectors v1,v2,v3\vec v_1,\vec v_2,\vec v_3 in R3\mathbb{R}^3, it produces three mutually orthogonal vectors w1,w2,w3\vec w_1,\vec w_2,\vec w_3 that are not of length 11 (the final normalization step is missing). The tips of the vectors can be dragged in “Edit v₁ v₂ v₃” mode.

1.00×
v₁, v₂, v₃ = w₁, w₂, w₃ = ‖w₁‖, ‖w₂‖, ‖w₃‖ = (not necessarily 1)w₁·w₂, w₁·w₃, w₂·w₃ =

Step 1. The first resulting vector coincides with v1\vec v_1: nothing needs to be subtracted or normalized.

w1=v1\vec w_1=\vec v_1

Step 2. The projection of v2\vec v_2 onto w1\vec w_1 is subtracted. Since w1\vec w_1 is not a unit vector, the projection coefficient is v2w1w1w1\dfrac{\vec v_2\cdot\vec w_1}{\vec w_1\cdot\vec w_1} (the dot product alone is not enough, as it would be with a unit vector):

w2=v2v2w1w1w1w1\vec w_2=\vec v_2-\dfrac{\vec v_2\cdot\vec w_1}{\vec w_1\cdot\vec w_1}\,\vec w_1

Step 3. Both projections are subtracted from v3\vec v_3, onto w1\vec w_1 and onto w2\vec w_2, using the same kind of coefficient normalized by the squared norm of the vector being projected onto:

w3=v3v3w1w1w1w1v3w2w2w2w2\vec w_3=\vec v_3-\dfrac{\vec v_3\cdot\vec w_1}{\vec w_1\cdot\vec w_1}\,\vec w_1-\dfrac{\vec v_3\cdot\vec w_2}{\vec w_2\cdot\vec w_2}\,\vec w_2

Pressing “Compute & keep” animates this sequence on the simulator, color by color, in the same order described above. The “slow motion” slider allows following it at a gentler pace, without changing the final result.

Below the simulator’s buttons, four numeric rows are always kept up to date:

  • the coordinates of the starting vectors v1,v2,v3\vec v_1,\vec v_2,\vec v_3 (also editable by typing them directly, in “Edit v₁ v₂ v₃” mode);
  • the coordinates of the resulting vectors w1,w2,w3\vec w_1,\vec w_2,\vec w_3, which appear one at a time during “Compute & keep”, in sync with the animation;
  • the norms w1,w2,w3\lVert\vec w_1\rVert,\lVert\vec w_2\rVert,\lVert\vec w_3\rVert, marked as “not necessarily 1” because, unlike the orthonormalized version, they are not generally expected to equal 11: the length of the resulting vectors depends on the starting vectors (for some particular starting triples they may still turn out to be 11: that is a special case, not the rule);
  • the cross dot products w1w2, w1w3, w2w3\vec w_1\cdot\vec w_2,\ \vec w_1\cdot\vec w_3,\ \vec w_2\cdot\vec w_3, which should instead stay at 00 (the resulting vectors are pairwise orthogonal, even though not unit length).

A zero dot product is, on its own, the defining property of orthogonality: that live number offers a way to check, for any linearly independent starting triple, that the process worked correctly, regardless of the length of the resulting vectors.