Skip to content
FiftyCalc Free calculators for all 50 states

Gram-Schmidt Calculator

Test cases replayed : 2 of 2 match · Methodology · No outside source listed

Enter three linearly independent vectors in 3D to get the orthogonal vectors u₁, u₂, u₃ and the orthonormal vectors e₁, e₂, e₃ of the Gram-Schmidt process.

Result

Sample figures

e₁ x (v₁ normalized)—

e₁ y (v₁ normalized) —

  • e₁ z (v₁ normalized)—
  • e₂ x (u₂ normalized)—
  • e₂ y (u₂ normalized)—
  • e₂ z (u₂ normalized)—
  • e₃ x (u₃ normalized)—
  • e₃ y (u₃ normalized)—
  • e₃ z (u₃ normalized)—
  • u₂ x = v₂ − (v₂·e₁)e₁—
  • u₂ y = v₂ − (v₂·e₁)e₁—
  • u₂ z = v₂ − (v₂·e₁)e₁—
  • u₃ x = v₃ − (v₃·e₁)e₁ − (v₃·e₂)e₂—
  • u₃ y = v₃ − (v₃·e₁)e₁ − (v₃·e₂)e₂—
  • u₃ z = v₃ − (v₃·e₁)e₁ − (v₃·e₂)e₂—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Gram-Schmidt Calculator

v₁: x: enter a number. Prefilled example: 1.

v₁: y: enter a number. Prefilled example: 1.

v₁: z: enter a number. Prefilled example: 0.

v₂: x: enter a number. Prefilled example: 1.

v₂: y: enter a number. Prefilled example: 0.

v₂: z: enter a number. Prefilled example: 1.

v₃: x: enter a number. Prefilled example: 0.

v₃: y: enter a number. Prefilled example: 1.

v₃: z: enter a number. Prefilled example: 1.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. v₁: x: enter a number.
  2. v₁: y: enter a number.
  3. v₁: z: enter a number.
  4. v₂: x: enter a number.
  5. v₂: y: enter a number.
  6. v₂: z: enter a number.
  7. v₃: x: enter a number.
  8. v₃: y: enter a number.
  9. v₃: z: enter a number.
  10. Read the result: e₁ x (v₁ normalized); the panel also shows e₁ y (v₁ normalized), e₁ z (v₁ normalized), u₂ x = v₂ − (v₂·e₁)e₁, u₂ y = v₂ − (v₂·e₁)e₁, u₂ z = v₂ − (v₂·e₁)e₁, e₂ x (u₂ normalized), e₂ y (u₂ normalized), e₂ z (u₂ normalized), u₃ x = v₃ − (v₃·e₁)e₁ − (v₃·e₂)e₂, u₃ y = v₃ − (v₃·e₁)e₁ − (v₃·e₂)e₂, u₃ z = v₃ − (v₃·e₁)e₁ − (v₃·e₂)e₂, e₃ x (u₃ normalized), e₃ y (u₃ normalized) and e₃ z (u₃ normalized).

How this calculator works

The Gram-Schmidt process builds orthogonal vectors one by one: u₁ = v₁; u₂ = v₂ − proj(v₂ on u₁); u₃ = v₃ − proj(v₃ on u₁) − proj(v₃ on u₂). Each uₖ is then divided by its length to give the unit vector eₖ = uₖ / |uₖ|.

With unit vectors, the projection of v on eₖ is (v · eₖ) eₖ, which is what the calculator subtracts. If the vectors are linearly dependent, some uₖ is the zero vector and its unit vector cannot be formed (shown as —).

The formula

  1. E1=a1a12+a22+a32
Symbols used in the formula
SymbolMeaning
a1v₁: x
a2v₁: y
a3v₁: z
E1e₁ x (v₁ normalized)

Worked example

v₁: x1
v₁: y1
v₁: z0
v₂: x1
v₂: y0
v₂: z1
v₃: x0
v₃: y1
v₃: z1
u₂ x = v₂ − (v₂·e₁)e₁0.5
e₂ x (u₂ normalized)0.4082
u₃ x = v₃ − (v₃·e₁)e₁ − (v₃·e₂)e₂-0.6667
e₃ x (u₃ normalized)-0.5774
e₁ y (v₁ normalized)0.7071
u₂ y = v₂ − (v₂·e₁)e₁-0.5
e₂ y (u₂ normalized)-0.4082
u₃ y = v₃ − (v₃·e₁)e₁ − (v₃·e₂)e₂0.6667
e₃ y (u₃ normalized)0.5774
e₁ z (v₁ normalized)0
u₂ z = v₂ − (v₂·e₁)e₁1
e₂ z (u₂ normalized)0.8165
u₃ z = v₃ − (v₃·e₁)e₁ − (v₃·e₂)e₂0.6667
e₃ z (u₃ normalized)0.5774
  1. E1=112+12+02=0.707107

e₁ x (v₁ normalized) 0.7071

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

What does the Gram-Schmidt process do?

It turns a set of linearly independent vectors into orthonormal vectors (perpendicular, each of length 1) that span the same space.

What is e₁ for v₁ = (1, 1, 0)?

v₁ divided by its length √2: (0.7071, 0.7071, 0).

Related calculators