Vector Projection Calculator
Find the scalar and vector projection of one vector onto another in 2D or 3D.
Vector a (projected)
Vector b (direction)
How it works
- 1Enter the components of vector a (the one being projected) and vector b (the direction) in 2D or 3D.
- 2The scalar projection is computed as (a · b) / |b| — the signed length of a’s shadow along b.
- 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.
Related tools
See all →Calculate the area and perimeter of a rectangle from its width and height, with a labeled diagram.
Calculate the area and circumference of a circle from its radius, with a labeled diagram.
Calculate the area (Heron’s formula) and perimeter of a triangle from its three sides.
Calculate the area and perimeter of a trapezoid from its two parallel sides, height, and legs.