Skip to main content
Skip to calculator
Advertisement

Last updated: July 31, 2026

Gram-Schmidt Calculator

Helpful
Not helpful
Save as image
Share
Embed
Cite
Write feedback

Formula

u₁ = v₁/||v₁||; w₂ = v₂ − proj_u₁(v₂); u₂ = w₂/||w₂||

Where:

  • v1x=v1 x
  • v1y=v1 y
  • v1z=v1 z
  • v2x=v2 x
  • v2y=v2 y
  • v2z=v2 z
Gram-Schmidt OrthogonalizationTwo vectors v1 and v2 with the projection of v2 onto v1 shown, and the resulting orthogonal vector u2 formed by subtracting the projection from v2.u₁ = v₁v₂proju₂Formulau₂ = v₂ - (v₂·u₁ / u₁·u₁) u₁
Subtracting the projection of v₂ onto u₁ leaves a vector u₂ that is orthogonal to u₁.

Worked Examples

Simple independent vectors

Orthogonalize v1=(1,1,0), v2=(1,0,1).

  1. 1Normalize v1 to get u1
  2. 2Subtract projection of v2 on u1
  3. 3Normalize remaining component for u2
Final Answer: u1 and u2 are unit vectors with dot(u1,u2)=0

Axis-aligned input

Use v1=(2,0,0), v2=(1,3,0).

  1. 1u1 points along x-axis
  2. 2Remove x projection from v2
  3. 3Normalize to get u2 along y direction
Final Answer: u1 ≈ (1,0,0), u2 ≈ (0,1,0)

General 3D case

Use v1=(3,1,2), v2=(2,2,1).

  1. 1Compute vector norms
  2. 2Project and subtract
  3. 3Normalize resulting basis vectors
Final Answer: Returns orthonormal pair suitable for basis construction

Introduction

Gram-Schmidt converts linearly independent vectors into an orthonormal basis. This calculator takes two 3D vectors and returns normalized orthogonal vectors.

Formula Overview

Gram-Schmidt Calculator uses a deterministic math model based on the calculator logic in calculation.ts.

  • u₁ = v₁/||v₁||; w₂ = v₂ − proj_u₁(v₂); u₂ = w₂/||w₂||

  • Inputs are validated before computation

  • Outputs are rounded consistently for readable results

  • Invalid values return safe fallback outputs

Input Guide

Use each input key exactly as defined below to match calculator wiring and test coverage.

  1. 1

    v1x: v1 x

  2. 2

    v1y: v1 y

  3. 3

    v1z: v1 z

  4. 4

    v2x: v2 x

  5. 5

    v2y: v2 y

  6. 6

    v2z: v2 z

Output Guide

These output IDs map directly to the return object keys in calculation.ts.

  1. 1

    u1x: x-component of first orthonormal vector

  2. 2

    u1y: y-component of first orthonormal vector

  3. 3

    u1z: z-component of first orthonormal vector

  4. 4

    u2x: x-component of second orthonormal vector

  5. 5

    u2y: y-component of second orthonormal vector

  6. 6

    u2z: z-component of second orthonormal vector

Validation Rules

The calculator checks for finite numeric values and applies domain constraints before solving.

  • Required fields must be present

  • Domain limits are enforced (for example positive lengths or valid operators)

  • Invalid or non-finite entries resolve to safe defaults

  • Use examples to verify expected behavior quickly

How to Use

Enter inputs, run calculation, and interpret the primary output first before reviewing supporting values.

  • Provide all required inputs

  • Click calculate

  • Read primary output first

  • Use secondary outputs for deeper analysis

Practical Uses

This calculator supports classroom work, engineering checks, and fast verification tasks.

  • Homework and exam preparation

  • Design and geometry validation

  • Spreadsheet cross-checking

  • Quick scenario analysis

FAQs

What does the Gram-Schmidt Calculator compute?

It computes u1 x, u1 y, u1 z from validated input values.

Which inputs are required?

Required inputs are: v1 x, v1 y, v1 z, v2 x, v2 y, v2 z.

How are invalid values handled?

If inputs are invalid or out of domain, the calculator returns safe default outputs instead of invalid math.

Are results rounded?

Yes. Numeric values are rounded in calculation.ts (typically to six decimal places).

Can I use negative or decimal values?

Decimals are accepted where mathematically valid; sign/domain constraints are enforced by the calculator logic.

How can I verify results?

Use the worked examples and compare each output key with manual calculations or trusted references.