Vector Projection Calculator

Project vector a onto vector b.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Enter vectors a and b to find the part of a that points along b. The projection of (2, 3, 1) onto (1, 1, 0) is (2.5, 2.5, 0).

How to use

1
Step 1
Enter the components of a.
2
Step 2
Enter the components of b.
3
Step 3
Press Calculate.

How it works

The projection is the shadow of a on the line through b: (a·b ÷ b·b) times b. For (2, 3, 1) and (1, 1, 0), a·b = 5 and b·b = 2, so the scalar is 2.5. Subtracting the projection from a leaves a vector perpendicular to b.

proj_b(a) = (a·b ÷ b·b) b

Worked example

Shadow on a diagonal

Input
a = (2, 3, 1), b = (1, 1, 0)
Output
(2.5, 2.5, 0)
Walkthrough
a·b = 2 + 3 + 0 = 5 and b·b = 1 + 1 = 2, so 5 ÷ 2 = 2.5, and 2.5 × (1, 1, 0) = (2.5, 2.5, 0).

Limitations

  • b = (0, 0, 0) has no direction, so the projection is undefined.
  • Three components; for 2D leave z as 0.

Questions

What is the projection of (3,4,0) onto (1,0,0)?
(3, 0, 0).
What is the projection of (2,3,1) onto (1,1,0)?
(2.5, 2.5, 0).
How do I get the perpendicular part?
Subtract the projection from a. For (2,3,1) that is (−0.5, 0.5, 1).

Features

  • 3D components
  • Shows the formula
  • Runs in your browser

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • Vectors | Essence of linear algebra

    3Blue1Brown

    Visual vectors when algebra tools move toward matrices.

    Watch on YouTube
  • Variables on both sides — example

    Khan Academy

    Worked example to check against solver output.

    Watch on YouTube