Scalar Projection Calculator

Enter two vectors to find the scalar projection of the first onto the second.

Write 2 or 3 numbers, like (1, 2, 3).

Write 2 or 3 numbers, like (4, 5, 6).

Try

Result

You enteredcompvu, u=(3,4), v=(1,0)\mathrm{comp}_{\mathbf{v}}\mathbf{u},\ \mathbf{u} = \left(3, 4\right),\ \mathbf{v} = \left(1, 0\right)

3\displaystyle 3

Vector projection

(3,0)\displaystyle \left(3, 0\right)
Show the work
  1. Dot product and squared length

    The projection needs the dot product u⋅v\mathbf{u} \cdot \mathbf{v}, which measures how far u\mathbf{u} points along v\mathbf{v}, and the squared length ∣v∣2\left|\mathbf{v}\right|^2 of the vector projected onto.

    u⋅v=3×1+4×0=3+0=3,  ∣v∣2=12+02=1+0=1\mathbf{u} \cdot \mathbf{v} = 3 \times 1 + 4 \times 0 = 3 + 0 = 3,\ \ \left|\mathbf{v}\right|^2 = 1^2 + 0^2 = 1 + 0 = 1
  2. Vector projection

    The projection of u\mathbf{u} onto v\mathbf{v} is the part of u\mathbf{u} that lies along v\mathbf{v}: a multiple of v\mathbf{v}, so it points along v\mathbf{v} (or opposite to it).

    projvu=u⋅v∣v∣2v=31(1,0)=3(1,0)=(3,0)\begin{aligned} \mathrm{proj}_{\mathbf{v}}\mathbf{u} &= \frac{\mathbf{u} \cdot \mathbf{v}}{\left|\mathbf{v}\right|^2}\mathbf{v} \\ &= \frac{3}{1}\left(1, 0\right) \\ &= 3\left(1, 0\right) \\ &= \left(3, 0\right) \end{aligned}
  3. Scalar projection

    The scalar projection is the signed length of that shadow: positive when u\mathbf{u} leans the same way as v\mathbf{v}, negative when it leans the other way.

    compvu=u⋅v∣v∣=31=3\begin{aligned} \mathrm{comp}_{\mathbf{v}}\mathbf{u} &= \frac{\mathbf{u} \cdot \mathbf{v}}{\left|\mathbf{v}\right|} \\ &= \frac{3}{1} \\ &= 3 \end{aligned}
  4. Result

    So the scalar projection of u\mathbf{u} onto v\mathbf{v} is 33.

Worked examples