Mathematics

Vector Projection: Formula, Rules & Examples

Vector projection finds the part of one vector that lies in the direction of another vector. If a is projected onto a nonzero vector b, the vector projection is proj_b a = (a·b/|b|²)b. The result is a vector parallel or antiparallel to b. A related quantity, the scalar projection or scalar component, is comp_b a = a·b/|b|, which gives the signed length of the projected component. Projection allows a vector to be decomposed into a component parallel to a chosen direction and a component perpendicular to that direction. It is used in geometry, force resolution, work calculations, least-squares methods, orthogonal decomposition, directional analysis, and linear algebra. The denominator can be simplified when the projection direction is already a unit vector. Understanding whether the problem asks for a scalar component, a projected vector, or a perpendicular remainder is essential because these are related but different quantities.

What Is Vector Projection?

Suppose two nonzero vectors are:

a

and:

b

Imagine dropping a perpendicular line from the tip of a onto the line through b.

The vector running along b to that perpendicular foot is the projection of a onto b.

It is written:

proj_b a

The result points parallel to b when the component of a lies in the same direction.

It points opposite b when the corresponding component is negative.

Projection is therefore a directional decomposition rather than simply a length calculation.

Vector Projection Formula

The formula for projecting a onto nonzero b is:

proj_b a = (a·b / |b|²)b

Since:

|b|² = b·b

the formula can also be written:

proj_b a = (a·b / b·b)b

The result is a scalar multiple of b, guaranteeing that the projection lies along the direction of b.

Scalar Projection Formula

The scalar projection of a onto b is:

comp_b a = a·b / |b|

This gives a signed scalar.

If:

comp_b a > 0

the projected component points with b.

If:

comp_b a < 0

it points opposite b.

If:

comp_b a = 0

the vectors are perpendicular.

Vector Projection Versus Scalar Projection

These two formulas answer different questions.

Scalar projection:

comp_b a = a·b/|b|

returns a number.

Vector projection:

proj_b a = (a·b/|b|²)b

returns a vector.

The relationship between them becomes especially clear using the unit vector:

u_b = b/|b|

Then:

proj_b a = (comp_b a)u_b

So the scalar component gives the signed length, while the unit vector supplies the direction.

Basic Vector Projection Example

Project:

a = (3, 4)

onto:

b = (1, 0)

First calculate the dot product:

a·b = 3(1) + 4(0)

= 3

Next:

|b|² = 1² + 0²

= 1

Therefore:

proj_b a = 3(1, 0)

= (3, 0)

The projection is simply the horizontal component.

Perpendicular Component

Once the projection is known, subtract it from the original vector:

a_perp = a − proj_b a

For the previous example:

a = (3, 4)

and:

proj_b a = (3, 0)

Therefore:

a_perp = (3, 4) − (3, 0)

= (0, 4)

So:

a = (3, 0) + (0, 4)

The first component is parallel to b.

The second is perpendicular to b.

Orthogonal Decomposition Formula

Any vector a can be decomposed relative to a nonzero vector b:

a = a_parallel + a_perp

where:

a_parallel = proj_b a

and:

a_perp = a − proj_b a

The perpendicular component satisfies:

a_perp·b = 0

This condition provides a useful check.

Verify Perpendicularity

Let:

a = (4, 3)

and:

b = (1, 1)

First:

a·b = 4 + 3

= 7

and:

|b|² = 1 + 1

= 2

Therefore:

proj_b a = 7/2(1, 1)

= (7/2, 7/2)

The perpendicular component is:

a_perp = (4, 3) − (7/2, 7/2)

= (1/2, −1/2)

Now check:

(1/2, −1/2)·(1, 1)

= 1/2 − 1/2

= 0

So the remainder is indeed perpendicular to b.

Projection Onto a Unit Vector

If u is already a unit vector:

|u| = 1

then:

|u|² = 1

and the projection formula simplifies to:

proj_u a = (a·u)u

The scalar projection becomes simply:

comp_u a = a·u

This is why unit vectors are especially convenient for directional calculations.

Unit-Vector Projection Example

Project:

a = (5, 2)

onto the unit vector:

u = (3/5, 4/5)

First:

a·u

= 5(3/5) + 2(4/5)

= 3 + 8/5

= 23/5

Therefore:

proj_u a = (23/5)(3/5, 4/5)

So:

proj_u a = (69/25, 92/25)

The scalar projection is:

23/5

Projection Using Vector Magnitude

The Vector Magnitude is essential because the projection direction must be normalized appropriately.

For:

b = (3, 4)

we have:

|b| = 5

and:

|b|² = 25

Therefore projecting a onto b requires:

(a·b)/25

as the scalar multiplying b.

Using only:

a·b

without the denominator would make the result depend incorrectly on how long b happens to be.

Why the Denominator Is |b|²

A projection should depend on the direction of b, not on an arbitrary scaling of that direction.

Suppose we replace b by:

2b

The projected vector should remain unchanged because b and 2b point along the same line.

Using the formula:

proj_(2b) a

= a·(2b) / |2b

The numerator gains a factor of 2.

The denominator gains a factor of 4.

The final vector contributes another factor of 2.

These factors cancel, leaving the same projection.

That scaling independence is built into:

|b

Projection and the Dot Product

The Dot Product formula is:

a·b = |a||b|cosθ

Divide by:

|b|

to obtain:

a·b/|b|

= |a|cosθ

Therefore:

comp_b a = |a|cosθ

This is exactly the signed length of a along the direction of b.

The vector projection then attaches that length to the unit direction of b.

Geometric Derivation of Projection

Let:

θ

be the angle between a and b.

The length of the adjacent side formed by resolving a along b is:

|a|cosθ

Since:

a·b = |a||b|cosθ

we obtain:

|a|cosθ = a·b/|b|

This is the scalar projection.

Multiply by:

b/|b|

to restore direction:

proj_b a

= (a·b/|b|)(b/|b|)

= (a·b/|b|²)b

Positive Projection

Suppose the angle between a and b is acute.

Then:

cosθ > 0

so:

a·b > 0

The scalar projection is positive.

The vector projection points in the same direction as b.

For example:

a = (3, 2)

b = (1, 0)

gives:

proj_b a = (3, 0)

which points in the positive x-direction.

Negative Projection

Suppose:

a = (−3, 4)

and:

b = (1, 0)

Then:

a·b = −3

Therefore:

proj_b a = (−3, 0)

The projection lies on the same line as b, but points in the opposite direction.

A negative scalar projection does not mean a negative length. It indicates orientation relative to the chosen direction.

Zero Projection

If:

a·b = 0

then:

proj_b a = 0

For example:

a = (2, 0)

b = (0, 5)

are perpendicular.

Their dot product is:

0

so a has no component along b.

This is precisely what projection should show geometrically.

3D Vector Projection Example

Project:

a = (2, 3, 4)

onto:

b = (1, 0, 2)

First:

a·b = 2(1) + 3(0) + 4(2)

= 10

Next:

|b|² = 1² + 0² + 2²

= 5

Therefore:

proj_b a = (10/5)(1, 0, 2)

= 2(1, 0, 2)

= (2, 0, 4)

The perpendicular component is:

a − proj_b a

= (2, 3, 4) − (2, 0, 4)

= (0, 3, 0)

As expected:

(0, 3, 0)·(1, 0, 2) = 0

Projection and Vector Operations

Projection combines several Vector Operations.

You need:

a dot product

a vector magnitude

scalar division

scalar multiplication

and often:

vector subtraction

The formula therefore provides a useful example of how basic vector operations combine to solve a geometric problem.

Projection Onto a Coordinate Axis

Projection onto coordinate axes is especially simple.

For:

a = (a₁, a₂, a₃)

projection onto:

i = (1, 0, 0)

is:

(a₁, 0, 0)

Projection onto:

j = (0, 1, 0)

is:

(0, a₂, 0)

Projection onto:

k = (0, 0, 1)

is:

(0, 0, a₃)

Ordinary vector components can therefore be viewed as projections onto coordinate directions.

Projection Onto a Line

Suppose a line through the origin has direction vector:

d

To project a onto the line, calculate:

proj_d a

The result is the point/vector on the line closest to a in the Euclidean sense.

If the line does not pass through the origin but instead passes through point p, first work with:

ap

then project that displacement onto d.

Finally add p back.

Closest Point on a Line Example

Let a line pass through:

P = (1, 1)

with direction:

d = (1, 2)

Find the projection of point:

Q = (4, 2)

onto the line.

First form:

PQ = Q − P

= (3, 1)

Project onto d:

PQ·d = 3(1) + 1(2)

= 5

and:

|d|² = 1 + 4

= 5

Therefore:

proj_d PQ = (1, 2)

Add P:

(1, 1) + (1, 2)

= (2, 3)

So:

(2, 3)

is the closest point on the line to Q.

Why Projection Gives the Closest Point

The difference between a and its projection onto b is perpendicular to b.

A perpendicular segment gives the shortest distance from a point to a line.

Therefore:

a_perp = a − proj_b a

represents the shortest displacement from a to the line spanned by b.

Its magnitude:

|a_perp|

is the corresponding distance.

Distance From a Vector to a Line

Suppose the line is spanned by nonzero b.

The distance from vector a to that line through the origin is:

d = |a − proj_b a|

For:

a = (4, 3)

b = (1, 1)

we previously found:

a_perp = (1/2, −1/2)

Therefore:

d = √[(1/2)² + (−1/2)²]

= √(1/2)

= 1/√2

The perpendicular component gives the shortest distance directly.

Projection and the Pythagorean Relationship

Because:

a_parallel

and:

a_perp

are perpendicular:

|a|² = |a_parallel|² + |a_perp

This is the vector version of the Pythagorean theorem.

It can be used to check a projection calculation.

If the squared component lengths do not add to the squared original magnitude, an arithmetic or formula error may have occurred.

Projection Example With Pythagorean Check

Take:

a = (3, 4)

and project onto the x-axis.

Then:

a_parallel = (3, 0)

and:

a_perp = (0, 4)

Magnitudes:

|a| = 5

|a_parallel| = 3

|a_perp| = 4

Check:

5² = 3² + 4²

25 = 9 + 16

The decomposition is consistent.

Projection Onto an Orthogonal Basis

Suppose:

u₁, u₂, …, uₙ

are mutually orthogonal nonzero vectors.

A vector a can be decomposed using:

a = Σ proj_ui a

when the vectors span the relevant space.

Each projection is:

proj_ui a = (a·uᵢ / |uᵢ|²)uᵢ

Orthogonality makes the components independent of one another.

This is a central idea in Basis And Dimension.

Projection Onto an Orthonormal Basis

If the basis vectors are unit vectors as well as orthogonal:

|uᵢ| = 1

then:

proj_ui a = (a·uᵢ)uᵢ

and the vector can be written:

a = Σ(a·uᵢ)uᵢ

This is one reason orthonormal coordinate systems are particularly convenient.

The dot products directly provide the coordinates.

Projection Onto a Subspace

Projection can extend from a single vector direction to an entire subspace.

If a subspace W has an orthonormal basis:

u₁, …, uₖ

then the orthogonal projection of a onto W is:

proj_W a = Σᵢ₌₁ᵏ (a·uᵢ)uᵢ

The residual:

a − proj_W a

is perpendicular to every vector in W.

This generalizes the line-projection formula.

Projection Matrix

Projection onto a line can also be represented by a matrix.

If u is a unit column vector, the projection matrix is:

P = u****u

Then:

Pa

is the projection of a onto the line spanned by u.

For a nonunit vector b:

P = b****bᵀ / (bb)

This creates a direct connection between projection and Matrix Multiplication.

Projection Matrix Example

Let:

u = (1, 0)

Then:

P = [1] [1 0]
[0]

so:

P = [ 1 0 ]
[ 0 0 ]

Apply P to:

a = (3, 4)

Then:

Pa = (3, 0)

which is exactly the projection onto the x-axis.

Projection as a Linear Transformation

Orthogonal projection onto a fixed subspace is a Linear Transformation.

It satisfies:

P(u + v) = Pu + Pv

and:

P(cv) = cPv

A projection transformation also satisfies:

P² = P

Applying the same projection twice does nothing new.

Once a vector has been projected into the target subspace, projecting it again leaves it unchanged.

Idempotent Projection

The property:

P² = P

is called idempotence.

Suppose P projects vectors onto the x-axis.

Then:

P(3, 4) = (3, 0)

Apply P again:

P(3, 0) = (3, 0)

The second projection produces no further change.

This is a defining structural property of projection operators.

Projection and Work

Mechanical work by a constant force F through displacement d is:

W = F·d

This can be interpreted using projection.

The scalar component of F along d is:

comp_d F

Multiplying that component by:

|d|

gives:

W = |d| comp_d F

So only the portion of force parallel to the displacement contributes to work.

Perpendicular force contributes zero dot-product work.

Projection and Directional Derivatives

A Directional Derivative is:

Dᵤf = ∇f·u

where u is a unit direction.

This dot product is exactly the scalar projection of the gradient onto the direction u.

Therefore a directional derivative measures the signed component of:

∇f

along the chosen direction.

The Gradient points in the direction that maximizes this projection.

Projection and Line Integrals

In a vector Line Integral:

∫꜀ F·dr

the dot product extracts the component of the vector field parallel to the infinitesimal path displacement.

Equivalently, the integral accumulates a projection of the field onto the path’s tangent direction.

A force perpendicular to the path contributes no work at that point.

This geometric interpretation makes projection central to understanding why the dot product appears in line integrals.

Projection and Cross Products

The Cross Product emphasizes the perpendicular rather than parallel relationship between vectors.

The dot product and projection isolate the parallel component.

The cross product’s magnitude:

|a × b|

measures perpendicular area behavior.

Together, these tools provide complementary descriptions of relative vector direction.

Projection and Vector Magnitude

Projection cannot be computed correctly without accounting for the magnitude of the reference vector.

The formula:

(a·b/|b|²)b

ensures that multiplying b by a scalar does not change the projected vector.

This is why Vector Magnitude is not merely an optional intermediate calculation; it normalizes the reference direction correctly.

Projection and Vector Operations

Within Vector Operations, projection is a composite operation.

It combines:

dot product

magnitude

scalar multiplication

and often:

subtraction

The specialist projection formula therefore builds on the more elementary operations rather than replacing them.

Projection and Triple Integrals

A Triple Integral accumulates through a three-dimensional region and is not itself a vector-projection procedure.

However, geometric projections of three-dimensional regions onto coordinate planes are often used when constructing triple-integration bounds.

For example, a solid may be projected onto the xy-plane to determine its outer double-integral region.

That geometric region projection should be distinguished from the algebraic vector projection:

proj_b a

The word “projection” appears in both settings, but the calculations serve different purposes.

Projection and Volume by Disks

In Volume By Disks, a three-dimensional solid is described through cross sections perpendicular to an axis.

The method may begin by interpreting a planar region relative to that axis, but it does not use the vector projection formula.

Vector projection decomposes one vector along another direction.

The disk method instead integrates:

πR²

across an interval to determine volume.

Keeping these meanings separate avoids confusing geometric visualization with an algebraic vector operation.

Projection and Volume by Shells

Volume By Shells similarly uses an axis and geometric distance, but its characteristic quantity is a cylindrical shell:

2π(radius)(height)(thickness)

A vector projection may help conceptually when resolving directions in a larger geometric model, but the shell formula does not calculate:

proj_b a

The two methods belong to different problem types even though both use directional geometry.

Projection Onto a Plane

In three dimensions, a vector can also be projected onto a plane.

Suppose a plane has unit normal vector:

n

The component of a normal to the plane is:

(a·n)n

Therefore the projection onto the plane is:

proj_plane a = a − (a·n)n

If n is not a unit vector:

proj_plane a

= a − (a·n/|n|²)n

This subtracts the normal component and leaves the part lying within the plane.

Plane Projection Example

Let:

a = (2, 3, 4)

and consider the xy-plane.

A unit normal is:

n = (0, 0, 1)

The normal projection is:

(a·n)n

= 4(0, 0, 1)

= (0, 0, 4)

Therefore the projection onto the xy-plane is:

(2, 3, 4) − (0, 0, 4)

= (2, 3, 0)

The z-component has been removed.

Projection and Distance to a Plane

If n is a unit normal and a represents a displacement from a point on a plane, then:

a·n

is the signed scalar projection onto the normal.

Its absolute value:

|a·n|

is the perpendicular distance to the plane.

Thus scalar projection naturally converts a displacement vector into normal distance.

Force Components

Suppose a force:

F

acts at an angle relative to a specified direction represented by unit vector u.

The force component along that direction is:

(F·u)u

Its scalar magnitude with sign is:

F·u

The perpendicular component is:

F − (F·u)u

This decomposition is widely used in mechanics because only certain force components may affect motion along a constrained direction.

Projection Example With Force

Let:

F = (10, 6)

and suppose motion is constrained along the x-axis:

u = (1, 0)

Then:

F·u = 10

so:

proj_u F = (10, 0)

The perpendicular force component is:

(0, 6)

Only the parallel component contributes directly to work for displacement confined to the x-axis.

Projection and Least-Squares Geometry

Suppose a linear system:

Ax = b

has no exact solution because b does not lie in the column space of A.

A least-squares approach chooses Ax to be the orthogonal projection of b onto the column space of A.

The residual:

b − Ax

is then perpendicular to every column of A.

This gives the normal-equation condition:

Aᵀ(Axb) = 0

or:

AᵀAx = Aᵀb

This is one of the most important advanced applications of projection.

Projection and Orthogonality

Orthogonality is the structural foundation of projection.

For:

a = a_parallel + a_perp

we require:

a_parallel

to lie in the target direction or subspace and:

a_perp

to be orthogonal to it.

That orthogonality condition makes the decomposition unique for projection onto a closed finite-dimensional subspace in ordinary Euclidean geometry.

Projection Onto the Same Direction

Projecting a vector onto itself gives the original vector:

proj_a a = a

for:

a0

Proof:

proj_a a

= (a·a/|a|²)a

Since:

a·a = |a

the coefficient is:

1

Therefore:

proj_a a = a

Projection Onto the Opposite Direction

Suppose the reference vector is:

b

instead of b.

The line spanned by the vector has not changed.

Therefore:

proj_(−b) a = proj_b a

The signed scalar projection relative to the chosen orientation changes sign, but the vector projection onto the line remains the same.

This distinction between an oriented direction and an unoriented line is useful in geometry.

Projection Onto a Scaled Vector

For any nonzero scalar c:

proj_(cb) a = proj_b a

because cb spans the same line as b.

This is another way to verify that the denominator:

|b

is necessary.

The vector projection depends only on the target line and its orientation through the final vector, not on the arbitrary length used to represent that direction.

Common Vector Projection Mistakes

A common mistake is confusing scalar projection with vector projection.

The scalar formula:

a·b/|b|

returns a number.

The vector formula:

(a·b/|b|²)b

returns a vector.

Another error is dividing by |b| rather than |b|² in the vector projection formula.

Students may also forget that projection onto the zero vector is undefined.

If the direction is supposed to be a unit vector, verify its magnitude before using the simplified formula.

A negative scalar projection does not indicate an invalid answer; it means the component points opposite the reference direction.

For orthogonal decomposition, the perpendicular component is found by subtracting the projection from the original vector.

Finally, always verify:

(a − proj_b ab = 0

when checking a calculation.

Frequently Asked Questions

What is vector projection?

Vector projection is the component of one vector that lies along the direction of another nonzero vector.

What is the vector projection formula?

proj_b a = (a·b/|b|²)b

What is scalar projection?

The scalar projection is:

comp_b a = a·b/|b|

It gives the signed length of the component of a along b.

What is the difference between scalar and vector projection?

Scalar projection returns a number. Vector projection returns a vector parallel or antiparallel to the reference vector.

Why is |b| squared in the vector projection formula?

The squared magnitude normalizes the reference vector so the result depends on its direction rather than its arbitrary length.

What happens when b is a unit vector?

The formula simplifies to:

proj_b a = (a·b)b

What happens when two vectors are perpendicular?

Their dot product is zero, so the projection is the zero vector.

Can a projection point opposite the reference vector?

Yes. If the dot product is negative, the projected component points opposite the reference vector.

How do you find the perpendicular component?

Use:

a_perp = a − proj_b a

How can I verify the perpendicular component?

Check:

a_perp·b = 0

How do you project onto a plane?

Subtract the component along the plane’s normal vector from the original vector.

Is projection a linear transformation?

Projection onto a fixed line or subspace is a linear transformation.

What property does a projection matrix satisfy?

A projection matrix satisfies:

P² = P

Least squares projects a target vector onto the column space of a matrix, producing the closest vector in that subspace.

How can I check a vector projection answer?

Confirm the result is parallel to the reference vector and verify that the remainder after subtraction is perpendicular to that reference vector.

Mehran Khan

Mehran Khan is the primary author at The Logic Library and CEO & Founder of One Digit Media. With 10+ years of experience in software engineering, SEO, and digital publishing, he uses a research-led approach to Logics, Maths, Tech, Formulas, Science, and AI.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button