Orthogonality
Orthogonal projections, bases, and distances
Orthogonalization
Projections & Decompositions
Distance Geometry
💡 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
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.
📑 Quick Navigation
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:
- 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:
Perpendicular Component
The perpendicular component is what's left after subtracting the parallel part:
The Scalar Projection
The scalar projection (also called the component) gives the signed magnitude:
📐 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
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
Step 2: Compute ‖v‖²
Step 3: Find parallel component (projection)
Step 4: Find perpendicular component
Step 5: Verify orthogonality
✓ 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
Step 2: Compute ‖v‖²
Step 3: Find parallel component
Step 4: Find perpendicular component
Step 5: Verify orthogonality
✓ 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
Step 2: Compute ‖v‖²
Step 3: Find parallel component
Step 4: Find perpendicular component
✓ 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:
✅ Uniqueness
The decomposition is unique for a given direction v.
✅ Pythagorean Theorem
✅ Linearity
The projection operation is linear:
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:
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
-
Decompose
u = (5, 0)alongv = (1, 0). What do you notice? -
Decompose
u = (0, 5)alongv = (1, 0). -
Find the parallel and perpendicular components of
u = (2, 2)alongv = (1, 1).
Intermediate
-
Decompose
u = (4, 3)alongv = (2, 1). -
Verify the Pythagorean theorem for the decomposition in problem #4.
-
Find the scalar projection of
u = (6, 8)ontov = (3, 4).
Advanced
-
In 3D, decompose
u = (1, 2, 3)alongv = (1, 0, 1). -
If u∥ = (2, 4) and u⟂ = (2, -1), find the original vector u.
-
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:
- Enter vector u (the vector to decompose)
- Enter direction vector v (the reference direction)
- 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!