DigitHelm
Linear Algebra

Vector Projection Calculator

Projection, Decomposition & Gram-Schmidt

Compute the projection of vector u onto v in 2D or 3D, decompose u into parallel and perpendicular components, find the angle between vectors, and orthogonalize up to three vectors using the Gram-Schmidt process. Computes unit vectors, magnitudes, dot products, and scalar projections with full working.

Instant Results100% FreeAny DeviceNo Sign-up

What Is the Vector Projection Calculator?

Vector projection decomposes a vector u into a component along v (the projection) and a component perpendicular to v. The scalar projection gives the signed length of the shadow of u onto v. Together, proj_v(u) + u⊥ = u — this orthogonal decomposition is fundamental in linear algebra, least-squares fitting, physics (work done by a force), and computer graphics. Gram-Schmidt extends projection to build orthogonal bases from any linearly independent set.

Vector Projection Calculator Formula and Method

proj_v(u) = (u·v / |v|²) · v

Scalar projection: comp_v(u) = u·v / |v|

Perpendicular: u⊥ = u − proj_v(u)

Angle: θ = arccos(u·v / (|u|·|v|))

Cross product (3D): u×v = (u₂v₃−u₃v₂, u₃v₁−u₁v₃, u₁v₂−u₂v₁)

How to Use

  1. 1

    Select 2D or 3D mode using the dimension buttons

  2. 2

    Enter vector u components (the vector to project)

  3. 3

    Enter vector v components (the direction to project onto)

  4. 4

    For Gram-Schmidt: enable the toggle and enter vector w

  5. 5

    Click Compute Projection

  6. 6

    View dot product, magnitudes, scalar and vector projection, perpendicular component, angle, and cross product (3D)

Vector Projection Calculator Example

Example: u=(3,4,0) onto v=(1,0,0)

u·v = 3·1 + 4·0 + 0·0 = 3

|v|² = 1 → scalar proj = 3/1 = 3

proj_v(u) = 3·(1,0,0) = (3,0,0)

u⊥ = (3,4,0) − (3,0,0) = (0,4,0)

Angle = arccos(3/5) ≈ 53.13°

Frequently Asked Questions

What is the physical meaning of projection?

Projection answers: how much of u lies along the direction of v? In physics, the work done by force F along displacement d is F·d = |F||d|cosθ — the scalar projection of F onto d times |d|. In geometry, the projection is the shadow of u onto the line defined by v.

What is the Gram-Schmidt process?

Gram-Schmidt converts any set of linearly independent vectors into an orthogonal (or orthonormal) set spanning the same space. Each vector is projected onto all previous orthogonal vectors and those components are subtracted. The result is a set of mutually perpendicular vectors — the foundation of QR decomposition.

When is the cross product useful?

The cross product u×v (3D only) returns a vector perpendicular to both u and v. Its magnitude |u×v| equals the area of the parallelogram spanned by u and v. It is used in physics (torque, angular momentum), graphics (surface normals), and geometry (testing coplanarity).

How is vector projection used in least squares?

The least-squares solution to an overdetermined system Ax=b is the projection of b onto the column space of A. The residual b−Ax is perpendicular to every column of A (the normal equations AᵀAx = Aᵀb). Each step of Gram-Schmidt is exactly such a projection.

You Might Also Like

Explore 450+ Free Calculators

From math and science to finance and everyday life — all free, no account needed.