Skip to main content
math

Vector Projection Calculator

Calculate the projection of one vector onto another, finding the component of the first vector that lies along the direction of the second.

Reviewed by Chase FloiedUpdated

This free online vector projection calculator provides instant results with no signup required. All calculations run directly in your browser — your data is never sent to a server. Enter your values below and see results update in real time as you type. Perfect for everyday calculations, homework, or professional use.

x component of the vector to project

y component of the vector to project

x component of the vector to project onto

y component of the vector to project onto

How to Use This Calculator

1

Enter your input values

Fill in all required input fields for the Vector Projection Calculator. Most fields include unit selectors so you can work in your preferred unit system — metric or imperial, whichever matches your problem.

2

Review your inputs

Double-check that all values are correct and that you have selected the right units for each field. Incorrect units are the most common source of calculation errors and can produce results that are off by factors of 2, 10, or more.

3

Read the results

The Vector Projection Calculator instantly computes the output and displays results with units clearly labeled. All calculations happen in your browser — no loading time and no data sent to a server.

4

Explore parameter sensitivity

Try adjusting individual input values to see how the output changes. This is a quick and effective way to develop intuition about how different parameters influence the result and to identify which inputs have the largest effect.

Formula Reference

Vector Projection Calculator Formula

See calculator inputs for the governing equation

Variables: All variables and their units are labeled in the calculator interface above. Input fields accept values in multiple unit systems — select your preferred unit from the dropdown next to each field.

When to Use This Calculator

  • Use the Vector Projection Calculator when you need a quick mathematical result without writing out all the steps manually, saving time on repetitive calculations.
  • Use it to verify hand calculations on tests or assignments and catch arithmetic mistakes.
  • Use it when teaching or explaining mathematical concepts to others, demonstrating how changing inputs affects the result.
  • Use it to explore the behavior of mathematical functions across a range of inputs.

About This Calculator

The Vector Projection Calculator is a free mathematical calculation tool for students, educators, and professionals who need quick, reliable results. Calculate the projection of one vector onto another, finding the component of the first vector that lies along the direction of the second. The underlying algorithms implement well-established mathematical formulas and numerical methods. Results are computed instantly in the browser. This tool is useful for learning, verification of hand calculations, and rapid exploration of mathematical relationships. All computation happens locally — no data is sent to a server.

About Vector Projection Calculator

Vector projection determines the component of one vector that lies along the direction of another vector. Given vectors A and B, the projection of A onto B produces a new vector that points in the direction of B and has a length equal to the shadow that A casts onto B. This operation is fundamental in physics for decomposing forces, in computer graphics for lighting calculations, and in linear algebra for constructing orthogonal bases via the Gram-Schmidt process. The scalar projection gives the signed length of this shadow, while the vector projection gives the full vector result. When the scalar projection is positive, A has a component in the direction of B; when negative, the component is in the opposite direction. This calculator computes both the scalar factor and the resulting vector projection components for two-dimensional vectors, providing a complete decomposition of how one vector relates to the direction of another.

The Math Behind It

The vector projection of A onto B is derived from the requirement that the difference A - proj_B(A) must be perpendicular to B. Setting the dot product of (A - cB) with B to zero yields c = (A·B)/(B·B), so proj_B(A) = ((A·B)/(B·B))B. The scalar projection, also called the component of A along B, equals (A·B)/|B| = |A|cos(θ), where θ is the angle between the vectors. The vector projection has magnitude |A|cos(θ) and direction B/|B|. The rejection of A from B is the orthogonal complement: A - proj_B(A), which is perpendicular to B. Together, the projection and rejection decompose A into parallel and perpendicular components relative to B. This decomposition is the foundation of the Gram-Schmidt orthogonalization process, which constructs an orthonormal basis from a set of linearly independent vectors. In physics, projecting a force vector onto a displacement vector gives the work-producing component of the force. In machine learning, projections onto principal component directions reduce dimensionality while preserving maximum variance.

Formula Reference

Vector Projection

proj_B(A) = ((A·B) / (B·B)) × B

Variables: A = vector being projected; B = vector projected onto

Worked Examples

Example 1: Project a vector onto the x-axis

Project A = (3, 4) onto B = (1, 0).

Step 1:A·B = 3×1 + 4×0 = 3
Step 2:B·B = 1×1 + 0×0 = 1
Step 3:Scalar factor = 3 / 1 = 3
Step 4:Projection = 3 × (1, 0) = (3, 0)
Step 5:Magnitude = sqrt(9 + 0) = 3

The projection of (3, 4) onto (1, 0) is (3, 0) with magnitude 3.

Example 2: Projection onto a diagonal vector

Project A = (4, 2) onto B = (1, 1).

Step 1:A·B = 4×1 + 2×1 = 6
Step 2:B·B = 1 + 1 = 2
Step 3:Scalar factor = 6 / 2 = 3
Step 4:Projection = 3 × (1, 1) = (3, 3)
Step 5:Magnitude = sqrt(9 + 9) = sqrt(18) ≈ 4.2426

The projection is (3, 3) with magnitude approximately 4.24.

Common Mistakes & Tips

  • !Dividing by |B| instead of B·B — the formula uses the squared magnitude, not the magnitude itself.
  • !Confusing scalar projection (a number) with vector projection (a vector) — the scalar is the factor, the vector includes direction.
  • !Projecting onto the zero vector, which is undefined since B·B = 0.
  • !Reversing the order: proj_B(A) and proj_A(B) are different operations with different results.

Related Concepts

Used in These Calculators

Calculators that build on or apply the concepts from this page:

Frequently Asked Questions

What is the difference between scalar and vector projection?

The scalar projection is a single number representing the signed length of A's shadow on B. The vector projection is a full vector that has this length and points in the direction of B. Multiply the scalar projection by the unit vector of B to get the vector projection.

Can the projection be longer than the original vector?

No. The magnitude of the projection is |A|cos(θ), which is at most |A| since |cos(θ)| ≤ 1. The projection is always shorter than or equal to the original vector.

What does a negative scalar projection mean?

A negative scalar projection means the angle between A and B is obtuse (greater than 90 degrees), so A has a component in the opposite direction of B.