Skip to content
math

Vector Projection Calculator

Find the scalar and vector projection of one vector onto another in 2D or 3D.

Vector a (projected)

Vector b (direction)

Scalar projection of a onto b
2.04
Vector projection of a onto b
(0.76, 1.9, 0)

How it works

  1. 1Enter the components of vector a (the one being projected) and vector b (the direction) in 2D or 3D.
  2. 2The scalar projection is computed as (a · b) / |b| — the signed length of a’s shadow along b.
  3. 3The vector projection is ((a · b) / (b · b)) · b — the component of a that lies exactly along b.

Use cases

  • Physics: decompose a force vector into components parallel and perpendicular to a surface.
  • Computer graphics: project a point onto a line or plane for shading and collision detection.
  • Machine learning: understand how one feature vector aligns with another in high-dimensional space.

Frequently asked questions

What is the difference between scalar projection and vector projection?

The scalar projection of a onto b is a single number — the signed length of a’s component along b. The vector projection is a vector pointing in b’s direction whose magnitude equals that scalar projection.

What happens when vector b is the zero vector?

Projection onto the zero vector is undefined. Both outputs will show — because dividing by |b| = 0 produces no meaningful result.

Can the scalar projection be negative?

Yes. A negative scalar projection means a and b point in generally opposite directions (the angle between them exceeds 90°), so the projection falls behind the origin along b.

See all →