MathorynMathematical Formula Database

Linear Algebra

Vector Projection

The projection of a\mathbf a onto b\mathbf b is the component of a\mathbf a in the direction of b\mathbf b. It is used in least squares, physics (resolving forces) and computer graphics.

proj⁡ba=a⋅b∣b∣2 b\operatorname{proj}_{\mathbf b}\mathbf a=\frac{\mathbf a\cdot\mathbf b}{|\mathbf b|^2}\,\mathbf b
LaTeX\operatorname{proj}_{\mathbf b}\mathbf a=\frac{\mathbf a\cdot\mathbf b}{|\mathbf b|^2}\,\mathbf b

Variables

a\mathbf a
vector being projected
b\mathbf b
nonzero direction vector

Example

Project a=(3,4)\mathbf a=(3,4) onto b=(2,1)\mathbf b=(2,1).

  1. a⋅b=10\mathbf a\cdot\mathbf b=10, ∣b∣2=5|\mathbf b|^2=5.
  2. 2⋅(2,1)2\cdot(2,1).

Answer: (4, 2)(4,\ 2).

Related formulas