Vector Projection Calculator

Last Updated: October 25, 2026

Calculate the vector projection, scalar projection, and rejection of one vector onto another in 2D or 3D.

Vector b sets the direction and must be nonzero. Use consistent units within each vector.

Precision and reverse projection

Vector Projection Formula

The vector projection of vector a onto vector b is the part of a that lies along the line defined by b. It is found by scaling the unit vector of b by the scalar projection.

proj_b(a) = (a . b / |b|^2) * b

The scalar projection (also called the component of a along b) is the signed length of that shadow.

comp_b(a) = a . b / |b|

The vector rejection is the part of a left over once the projection is removed. It is perpendicular to b.

rej_b(a) = a - proj_b(a)
  • a is the vector being projected.
  • b is the vector you are projecting onto (the direction).
  • a . b is the dot product of a and b. In 2D it equals ax*bx + ay*by, and in 3D it equals ax*bx + ay*by + az*bz.
  • |b| is the magnitude (length) of b, equal to the square root of b . b.
  • proj_b(a) is the vector projection, a vector pointing along b.
  • comp_b(a) is the scalar projection, a single signed number.
  • rej_b(a) is the vector rejection, perpendicular to b.

Choose your solve-for mode to return any one of these results, or use the full report to see them together. For nonzero vectors, a positive dot product means an acute angle, a negative dot product means an obtuse angle, and a zero dot product means a right angle. A zero vector a has a zero projection but no defined angle.

Projection Quantities at a Glance

The table below summarizes what each output is, its formula, and the type of value you get back.

QuantityFormulaResult type
Scalar projectiona . b / |b|Single number (signed length)
Vector projection(a . b / |b|^2) * bVector along b
Vector rejectiona – proj_b(a)Vector perpendicular to b

The sign of the scalar projection tells you the geometric relationship between the two vectors, which the next table interprets.

Scalar projectionAngle between a and bMeaning
PositiveLess than 90 degreesa leans in the same direction as b
Zero90 degrees for nonzero a; undefined for zero aProjection is the zero vector; zero a has no direction
NegativeMore than 90 degreesa leans opposite to b, projection points against b

Example Problems

Example 1 (2D). Project a = (3, 4) onto b = (1, 0).

  • Dot product: a . b = 3*1 + 4*0 = 3.
  • Magnitude squared: |b|^2 = 1^2 + 0^2 = 1.
  • Scalar projection: 3 / 1 = 3.
  • Vector projection: (3 / 1) * (1, 0) = (3, 0).
  • Vector rejection: (3, 4) – (3, 0) = (0, 4).

Example 2 (3D). Project a = (2, 1, 2) onto b = (0, 3, 4).

  • Dot product: a . b = 2*0 + 1*3 + 2*4 = 11.
  • Magnitude squared: |b|^2 = 0^2 + 3^2 + 4^2 = 25, so |b| = 5.
  • Scalar projection: 11 / 5 = 2.2.
  • Vector projection: (11 / 25) * (0, 3, 4) = (0, 1.32, 1.76).
  • Vector rejection: (2, 1, 2) – (0, 1.32, 1.76) = (2, -0.32, 0.24).

Frequently Asked Questions

What is the difference between scalar projection and vector projection?

The scalar projection is a single signed number that gives the length of a along the direction of b. The vector projection takes that length and attaches a direction to it, producing a vector that lies along b. The scalar projection answers how much, while the vector projection answers how much and in which direction.

What is vector rejection?

The vector rejection is whatever is left of a after you subtract the vector projection. It is the component of a that is perpendicular to b. Adding the projection and the rejection back together always reconstructs the original vector a.

Can you project a vector onto the zero vector?

No. The formulas divide by the magnitude of b, and the zero vector has a magnitude of zero, which makes the division undefined. The vector you project onto must have a length greater than zero, so it points in a definite direction.

Vector Projection Calculator screenshot