Skip to content
FiftyCalc Free calculators for all 50 states

Vector Projection Calculator

Test cases replayed : 2 of 2 match · Methodology · No outside source listed

Enter vectors a and b (z = 0 for 2D) to get the projection of a onto b and the part of a that is perpendicular to b.

Result

Sample figures

Vector projection proj_b a: x—

Vector projection proj_b a: y —

  • Vector projection proj_b a: z—
  • Dot product a · b—
  • |b|²—
  • Scalar projection a · b ÷ |b|—
  • Perpendicular part a − proj_b a: x—
  • Perpendicular part a − proj_b a: y—
  • Perpendicular part a − proj_b a: z—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Vector Projection Calculator

a: x component: enter a number. Prefilled example: 1.

a: y component: enter a number. Prefilled example: 2.

a: z component (0 for 2D): enter a number. Prefilled example: 3.

b: x component: enter a number. Prefilled example: 4.

b: y component: enter a number. Prefilled example: 5.

b: z component (0 for 2D): enter a number. Prefilled example: 6.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. a: x component: enter a number.
  2. a: y component: enter a number.
  3. a: z component (0 for 2D): enter a number.
  4. b: x component: enter a number.
  5. b: y component: enter a number.
  6. b: z component (0 for 2D): enter a number.
  7. Read the result: Vector projection proj_b a: x; the panel also shows Dot product a · b, |b|², Scalar projection a · b ÷ |b|, Vector projection proj_b a: y, Vector projection proj_b a: z, Perpendicular part a − proj_b a: x, Perpendicular part a − proj_b a: y and Perpendicular part a − proj_b a: z.

How this calculator works

The vector projection of a onto a nonzero vector b is proj_b a = (a · b ÷ |b|²) b, where a · b = aₓbₓ + a_yb_y + a_zb_z. Its signed length is the scalar projection a · b ÷ |b|, negative when the angle between a and b is more than 90°.

The rest of a, a − proj_b a, is perpendicular to b (its dot product with b is 0). Together they split a into a part along b and a part across it, as in the Gram–Schmidt process. Projection onto the zero vector is undefined and shows dashes.

The formula

  1. Dot=ax×bx+ay×by+az×bz
  2. Nb2=bx2+by2+bz2
  3. Px=DotNb2×bx+0
Symbols used in the formula
SymbolMeaning
axa: x component
aya: y component
aza: z component (0 for 2D)
bxb: x component
byb: y component
bzb: z component (0 for 2D)
DotDot product a · b
Nb2|b|²
PxVector projection proj_b a: x

Worked example

a: x component1
a: y component2
a: z component (0 for 2D)3
b: x component4
b: y component5
b: z component (0 for 2D)6
Dot product a · b32
Scalar projection a · b ÷ |b|3.6467
Vector projection proj_b a: y2.0779
Vector projection proj_b a: z2.4935
Perpendicular part a − proj_b a: x-0.6623
Perpendicular part a − proj_b a: y-0.0779
Perpendicular part a − proj_b a: z0.5065
  1. Dot=1×4+2×5+3×6=32
  2. Nb2=42+52+62=77
  3. Px=3277×4+0=1.66234

Vector projection proj_b a: x 1.6623

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

What is the projection of (3, 4) onto the x-axis (1, 0)?

(3, 0). The scalar projection is 3 and the perpendicular part is (0, 4).

What is the projection of (1, 2, 3) onto (4, 5, 6)?

a · b = 32 and |b|² = 77, so proj = (32/77)(4, 5, 6) ≈ (1.6623, 2.0779, 2.4935).

Related calculators