Vector Projection Calculator
Decompose vectors in 2D and 3D space into parallel projections ($\text{proj}_\mathbf{v}\mathbf{u}$), signed scalar components ($\text{comp}_\mathbf{v}\mathbf{u}$), orthogonal rejections ($\mathbf{u}_\perp$), and mechanical work.
2D Geometric Projection & Orthogonal Drop
Shadow proj_v(u)Step-by-Step Projection Formula & Decomposition Formula: proj_v(u) = [(u · v) / ||v||²] v
How to Calculate Vector and Scalar Projections
To find the vector projection of vector u onto vector v (proj_v u), calculate the dot product u · v, divide by the squared magnitude of the base vector ||v||², and multiply by vector v: proj_v(u) = ((u · v) / ||v||²) v. To find the signed scalar component (comp_v u), divide the dot product by the single magnitude of v: comp_v(u) = (u · v) / ||v||. The orthogonal rejection is found by subtracting the projection from u: u_⊥ = u - proj_v(u).
Anatomy of Vector Projection & The Shadow Concept
Imagine shining a light perpendicular to the line containing vector $\mathbf{v}$. The shadow cast by vector $\mathbf{u}$ directly onto $\mathbf{v}$ is the vector projection ($\text{proj}_\mathbf{v}\mathbf{u}$).
A full directional vector lying strictly along the line of base vector v.
A single signed real number representing the length and sign of the shadow.
The perpendicular rejection vector satisfying u_⊥ · v = 0.
Vector Projection vs Scalar Projection (Component)
Students often confuse scalar projection (a magnitude) with vector projection (a vector with direction):
1. Scalar Projection (Length):
comp_v(u) = (u · v) / ||v|| = ||u|| cos(θ)
2. Vector Projection (Vector):
proj_v(u) = comp_v(u) × (v / ||v||) = [ (u · v) / ||v||² ] v
Orthogonal Decomposition & Vector Rejection (Gram-Schmidt)
Any vector $\mathbf{u}$ can be uniquely decomposed into two mutually perpendicular vectors relative to $\mathbf{v}$:
&mathbf;u = &mathbf;u_∥ + &mathbf;u_⊥
&mathbf;u_∥ = proj_v(u) (Parallel Component)
&mathbf;u_⊥ = &mathbf;u − proj_v(u) (Perpendicular Rejection)
This orthogonal decomposition is the exact fundamental step used in the Gram-Schmidt process to create orthonormal bases in higher dimensions.
2D and 3D Projection Formulas with Dot Products
The algebraic steps for computing projections in Cartesian coordinates:
- Compute Dot Product: $\mathbf{u} \cdot \mathbf{v} = u_1 v_1 + u_2 v_2 + u_3 v_3$.
- Compute Base Magnitude Squared: $\|\mathbf{v}\|^2 = v_1^2 + v_2^2 + v_3^2$.
- Form Scalar Multiplier: $c = \frac{\mathbf{u} \cdot \mathbf{v}}{\|\mathbf{v}\|^2}$.
- Multiply by Base Vector: $\text{proj}_\mathbf{v}(\mathbf{u}) = c \langle v_1, v_2, v_3 \rangle = \langle c v_1, c v_2, c v_3 \rangle$.
Physics Applications: Work Done & Force Along an Incline
In classical mechanics, when a force $\mathbf{F}$ moves an object through displacement $\mathbf{d}$, the work performed is determined solely by the parallel force component:
Any force component acting perpendicular to $\mathbf{d}$ (such as normal force on a level surface) performs zero mechanical work ($W_{\perp} = 0$).
Step-by-Step Worked Examples (2D, 3D & Mechanical Work)
Project u = ⟨1, 2, 3⟩ onto v = ⟨4, 0, 2⟩.
1. Dot Product: u · v = (1)(4) + (2)(0) + (3)(2) = 4 + 0 + 6 = 10.
2. Base Magnitude Squared: ||v||² = 4² + 0² + 2² = 16 + 0 + 4 = 20.
3. Scalar Multiplier: c = 10 / 20 = 0.5.
4. Vector Projection: proj_v(u) = 0.5 × ⟨4, 0, 2⟩ = ⟨2, 0, 1⟩.
5. Scalar Component: comp_v(u) = 10 / √20 = 10 / 4.472 = 2.236.
6. Orthogonal Rejection: u_⊥ = ⟨1, 2, 3⟩ − ⟨2, 0, 1⟩ = ⟨−1, 2, 2⟩ (Check: ⟨−1, 2, 2⟩ · ⟨4, 0, 2⟩ = −4 + 0 + 4 = 0 ✓).
Common Conceptual Errors & Negative Scalar Projections
When projecting $\mathbf{u}$ onto $\mathbf{v}$, you must divide by the magnitude of the base vector $\mathbf{v}$ ($\|\mathbf{v}\|^2$), never the target vector $\|\mathbf{u}\|^2$.
Scalar projection is a signed length. When the angle between vectors exceeds $90^\circ$, $\text{comp}_\mathbf{v}(\mathbf{u}) < 0$, indicating that the projection points in the opposite direction of $\mathbf{v}$.
Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.
Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.