StatGardenREF. DESK
Calculators/Maths/Vector projection
Maths

Vector projection calculator

Projects vector a onto vector b in 3D (set z = 0 for 2D vectors).

What this calculator does

Vector projection works out projects vector a onto vector b in 3D (set z = 0 for 2D vectors). Enter your own figures above and the answer updates as you type: nothing is fixed in the code, so the result reflects exactly the numbers you supply.

The formula this calculator evaluates is printed under the tool and explained below, so you can check the working by hand or reuse it in a spreadsheet.

The formula

Formulascalar projection = (a·b)/|b|; vector projection = [(a·b)/|b|²]·b

The inputs explained

FieldWhat to enter
a: xA number. Starts at 3.
a: yA number. Starts at 4.
a: zA number. Starts at 0.
b: xA number. Starts at 5.
b: yA number. Starts at 0.
b: zA number. Starts at 0.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How the answer changes with a: x

Every other input is held at the calculator’s starting values while a: x varies. Select any row to load that scenario into the calculator.

How the answer changes with a: x
a: xVector projectionScalar projectiona·b
1.5 (1.500, 0, 0)1.5007.500
2.25 (2.250, 0, 0)2.25011.250
3 (3.000, 0, 0)3.00015.000
4.5 (4.500, 0, 0)4.50022.500
6 (6.000, 0, 0)6.00030.000
9 (9.000, 0, 0)9.00045.000