Skip to main content
Home / Orthogonality / Orthogonal Decomposition

Orthogonality

Orthogonal projections, bases, and distances

💡 Need Help?

  • • Enter fractions like 1/2
  • • Use decimals like 0.5
  • • Click "Load Example" to try a preset
  • • Click any step to copy LaTeX
Calculating...

Orthogonal Decomposition Calculator

Orthogonal decomposition breaks a vector into two components: one parallel to a reference direction and one perpendicular to it. This is fundamental for understanding projections, forces in physics, and many engineering applications.

Dimension: D

Vector u (to decompose)

Vector v (reference direction)

Decomposes vector u into components parallel and perpendicular to v. Enter fractions like 1/2 or decimals like 0.5.

What is Orthogonal Decomposition?

Orthogonal decomposition (also called vector projection decomposition) is the process of breaking a vector into two perpendicular components: one that lies along a given direction and one that is perpendicular to it.

Core Idea: Any vector u can be uniquely written as the sum of two vectors:

$$ \boxed{\mathbf{u} = \mathbf{u}_{\parallel} + \mathbf{u}_{\perp}} $$
  • u∥ (parallel component) - lies along the direction of vector v
  • u⟂ (perpendicular component) - orthogonal to v

💡 Key Insight: The parallel component is the projection of u onto v, and the perpendicular component is what remains. Together, they satisfy u∥ · u⟂ = 0.


The Mathematical Formula

Parallel Component (Projection)

The parallel component is the projection of u onto v:

$$ \boxed{\mathbf{u}_{\parallel} = \text{proj}_{\mathbf{v}} \mathbf{u} = \frac{\mathbf{u} \cdot \mathbf{v}}{\|\mathbf{v}\|^2} \mathbf{v}} $$

Perpendicular Component

The perpendicular component is what's left after subtracting the parallel part:

$$ \boxed{\mathbf{u}_{\perp} = \mathbf{u} - \mathbf{u}_{\parallel}} $$

The Scalar Projection

The scalar projection (also called the component) gives the signed magnitude:

$$ \boxed{\text{comp}_{\mathbf{v}} \mathbf{u} = \frac{\mathbf{u} \cdot \mathbf{v}}{\|\mathbf{v}\|}} $$

📐 Relationship: The scalar projection tells you how much of u lies along v, while the vector projection tells you the actual vector.


Geometric Interpretation

In 2D Space

Imagine vector u and direction vector v:

  • u∥ is the shadow of u cast onto the line of v
  • u⟂ is the height of u above that line
  • The two components form a right triangle
$$ \|\mathbf{u}\|^2 = \|\mathbf{u}_{\parallel}\|^2 + \|\mathbf{u}_{\perp}\|^2 $$

This is the Pythagorean theorem in vector form!

In 3D Space

The same principle extends to 3D:

  • u∥ lies along the line spanned by v
  • u⟂ lies in the plane perpendicular to v
  • Orthogonality is preserved in higher dimensions

Visualization: Think of u as an arrow in space. Shine a light perpendicular to v. The shadow on the line of v is u∥. The distance from the tip of u to the line is ‖u⟂‖.


Step-by-Step Examples

Example 1: 2D Decomposition

Problem: Decompose u = (3, 4) parallel and perpendicular to v = (1, 0) (the x-axis).

Step 1: Compute dot product u·v

$$ \mathbf{u} \cdot \mathbf{v} = (3)(1) + (4)(0) = 3 $$

Step 2: Compute ‖v‖²

$$ \|\mathbf{v}\|^2 = 1^2 + 0^2 = 1 $$

Step 3: Find parallel component (projection)

$$ \mathbf{u}_{\parallel} = \frac{3}{1} \cdot (1, 0) = (3, 0) $$

Step 4: Find perpendicular component

$$ \mathbf{u}_{\perp} = (3, 4) - (3, 0) = (0, 4) $$

Step 5: Verify orthogonality

$$ \mathbf{u}_{\parallel} \cdot \mathbf{u}_{\perp} = (3)(0) + (0)(4) = 0 \quad \checkmark $$

✓ Result: u∥ = (3, 0), u⟂ = (0, 4). Notice this matches the x and y components!

Example 2: Decomposition Along a Diagonal

Problem: Decompose u = (3, 4) parallel and perpendicular to v = (1, 1).

Step 1: Compute u·v

$$ \mathbf{u} \cdot \mathbf{v} = 3(1) + 4(1) = 7 $$

Step 2: Compute ‖v‖²

$$ \|\mathbf{v}\|^2 = 1^2 + 1^2 = 2 $$

Step 3: Find parallel component

$$ \mathbf{u}_{\parallel} = \frac{7}{2}(1, 1) = (3.5, 3.5) $$

Step 4: Find perpendicular component

$$ \mathbf{u}_{\perp} = (3, 4) - (3.5, 3.5) = (-0.5, 0.5) $$

Step 5: Verify orthogonality

$$ \mathbf{u}_{\parallel} \cdot \mathbf{u}_{\perp} = (3.5)(-0.5) + (3.5)(0.5) = -1.75 + 1.75 = 0 \quad \checkmark $$

✓ Result: u∥ = (3.5, 3.5), u⟂ = (-0.5, 0.5)

Notice u⟂ is perpendicular to (1,1) because (-0.5,0.5)·(1,1) = -0.5 + 0.5 = 0!

Example 3: 3D Decomposition

Problem: Decompose u = (2, 3, 1) along v = (1, 0, 0) (the x-axis).

Step 1: Compute u·v

$$ \mathbf{u} \cdot \mathbf{v} = 2(1) + 3(0) + 1(0) = 2 $$

Step 2: Compute ‖v‖²

$$ \|\mathbf{v}\|^2 = 1^2 = 1 $$

Step 3: Find parallel component

$$ \mathbf{u}_{\parallel} = \frac{2}{1}(1, 0, 0) = (2, 0, 0) $$

Step 4: Find perpendicular component

$$ \mathbf{u}_{\perp} = (2, 3, 1) - (2, 0, 0) = (0, 3, 1) $$

✓ Result: The x-component (2) is parallel to the x-axis, while the y and z components (3,1) form the perpendicular part in the yz-plane.


Key Properties

✅ Orthogonality

The parallel and perpendicular components are always orthogonal:

$$ \mathbf{u}_{\parallel} \cdot \mathbf{u}_{\perp} = 0 $$

✅ Uniqueness

The decomposition is unique for a given direction v.

✅ Pythagorean Theorem

$$ \|\mathbf{u}\|^2 = \|\mathbf{u}_{\parallel}\|^2 + \|\mathbf{u}_{\perp}\|^2 $$

✅ Linearity

The projection operation is linear:

$$ \text{proj}_{\mathbf{v}}(\mathbf{a} + \mathbf{b}) = \text{proj}_{\mathbf{v}}\mathbf{a} + \text{proj}_{\mathbf{v}}\mathbf{b} $$

Special Cases

Condition Parallel Component Perpendicular Component
u is parallel to v u∥ = u u⟂ = 0
u is perpendicular to v u∥ = 0 u⟂ = u
v is a unit vector u∥ = (u·v)v u⟂ = u - (u·v)v
u = 0 (zero vector) u∥ = 0 u⟂ = 0

Real-World Applications

🎮 Physics & Engineering

  • Forces on an Incline: Decompose gravity into parallel (causes sliding) and perpendicular (creates normal force) components
  • Inclined Planes: Calculate work done against gravity
  • Ramp Design: Determine required friction based on parallel component

📐 Computer Graphics

  • Shadow Projection: Cast shadows onto surfaces using projection
  • Collision Detection: Decompose velocities relative to collision normals
  • Ray Tracing: Calculate reflections using perpendicular components

🤖 Machine Learning

  • Principal Component Analysis (PCA): Decomposes data into principal directions
  • Residuals: The perpendicular component represents the error or "unexplained" part
  • Dimension Reduction: Keep parallel components, discard perpendicular noise

📡 Signal Processing

  • Noise Filtering: Decompose signals into meaningful (parallel) and noise (perpendicular) components
  • Correlation Analysis: Project signals onto reference waveforms

🔧 Practical Example: Inclined Plane

An object of weight W = 100 N sits on a ramp inclined at θ = 30°. The decomposition is:

$$ \begin{aligned} \text{Parallel: } W_{\parallel} &= W \sin\theta = 100 \cdot 0.5 = 50 \text{ N (pulls down the ramp)} \\ \text{Perpendicular: } W_{\perp} &= W \cos\theta = 100 \cdot 0.866 = 86.6 \text{ N (into the ramp)} \end{aligned} $$

The parallel component causes sliding, while the perpendicular component determines the normal force (friction).


Frequently Asked Questions

Q: What's the difference between scalar and vector projection?

A: Scalar projection gives the signed magnitude (a number), while vector projection gives the actual vector along v. The vector projection = (scalar projection) × (unit vector in direction of v).

Q: Is the decomposition unique?

A: Yes! For a given direction v, the decomposition into parallel and perpendicular components is unique. This is a fundamental property of orthogonal projections.

Q: What if v is the zero vector?

A: Decomposition is not defined for v = 0 because there's no direction to project onto. The calculator will return an error.

Q: How is this related to Gram-Schmidt orthogonalization?

A: Gram-Schmidt uses orthogonal decomposition repeatedly. It subtracts projections onto previous vectors to create orthogonal basis vectors.

Q: Does the order of u and v matter?

A: Yes! u is the vector being decomposed, v is the direction vector. Decomposing u along v is different from decomposing v along u.

Q: Can I decompose into more than two components?

A: Yes! For multiple orthogonal directions, you can decompose into components along each basis vector. This is the foundation of coordinate systems.


Practice Problems

Beginner

  1. Decompose u = (5, 0) along v = (1, 0). What do you notice?

  2. Decompose u = (0, 5) along v = (1, 0).

  3. Find the parallel and perpendicular components of u = (2, 2) along v = (1, 1).

Intermediate

  1. Decompose u = (4, 3) along v = (2, 1).

  2. Verify the Pythagorean theorem for the decomposition in problem #4.

  3. Find the scalar projection of u = (6, 8) onto v = (3, 4).

Advanced

  1. In 3D, decompose u = (1, 2, 3) along v = (1, 0, 1).

  2. If u∥ = (2, 4) and u⟂ = (2, -1), find the original vector u.

  3. Prove that u - proj_v(u) is always perpendicular to v.

Click to reveal solutions

1. u∥ = (5, 0), u⟂ = (0, 0). When u is parallel to v, it's already along the direction.

2. u∥ = (0, 0), u⟂ = (0, 5). When u is perpendicular to v, the parallel component is zero.

3. u∥ = (2, 2), u⟂ = (0, 0). u is already parallel to v.

4. u∥ = (4.4, 2.2), u⟂ = (-0.4, 0.8)

5. ‖u‖² = 25, ‖u∥‖² + ‖u⟂‖² = (4.4²+2.2²) + ((-0.4)²+0.8²) = 24.2 + 0.8 = 25 ✓

6. comp_v u = (6·3 + 8·4)/5 = (18+32)/5 = 10

7. u∥ = (2, 0, 2), u⟂ = (-1, 2, 1)

8. u = u∥ + u⟂ = (2+2, 4+(-1)) = (4, 3)

9. (u - proj_v(u))·v = u·v - (u·v/‖v‖²)v·v = u·v - u·v = 0 ✓



Summary

🎯 Key Takeaways

  • Orthogonal decomposition: u = u∥ + u⟂ with u∥ · u⟂ = 0
  • Parallel component (projection): u∥ = proj_v(u) = ((u·v)/(‖v‖²)) v
  • Perpendicular component: u⟂ = u - u∥
  • Scalar projection: comp_v(u) = (u·v)/‖v‖ (signed magnitude)
  • Pythagorean theorem: ‖u‖² = ‖u∥‖² + ‖u⟂‖²
  • Applications: Physics (forces on ramps), graphics (shadows), ML (PCA residuals)

💡 Memory Trick: The projection u∥ is the "shadow" of u on the line of v. The perpendicular component u⟂ is the "height" above that line.

Try It Yourself!

Use the calculator above to decompose any vector:

  1. Enter vector u (the vector to decompose)
  2. Enter direction vector v (the reference direction)
  3. Click "Calculate" to see:
    • Parallel component (projection of u onto v)
    • Perpendicular component (remainder)
    • Verification of orthogonality (dot product = 0)
    • Step-by-step breakdown of calculations
    • Geometric interpretation

📐 Test these examples:

  • Parallel vectors: u = (2, 4), v = (1, 2) → u∥ should equal u
  • Perpendicular vectors: u = (2, 0), v = (0, 3) → u∥ should be zero
  • 2D general: u = (3, 4), v = (1, 1) → balanced components
  • 3D example: u = (2, 3, 1), v = (1, 0, 0) → isolates x-component

📐 Pro Tip: The perpendicular component is always orthogonal to v. Verify this by computing the dot product u⟂ · v—it should always be zero!