---
tag: 0G78GP5TF1
kind: definition
name: Vector projection
msc: [51N20]
defines: 0JW13B48YP
uses: [0QN3D80AWP, 0XKBKGTCPC, 03NK6RSRQ1]
sources:
  - url: https://en.wikipedia.org/wiki/Vector_projection
    locator: Definitions in terms of a and b
---

## Definition

Let $n$ be a positive integer, let $a$ be a vector in $\mathbb{R}^n$, and let $b$ be a nonzero vector in $\mathbb{R}^n$. Let $a \cdot b = a_1 b_1 + \dots + a_n b_n$ be the dot product.
The vector projection of $a$ onto $b$ is the vector
$$\operatorname{proj}_b a = \frac{a \cdot b}{b \cdot b} \, b.$$
The scalar projection of $a$ onto $b$ is the real number $\dfrac{a \cdot b}{\|b\|}$, where $\|b\|$ is the [[length|0XKBKGTCPC]] of $b$.

## Remarks

The vector $a - \operatorname{proj}_b a$ is the vector rejection of $a$ from $b$. Its dot product with $b$ is $0$, so it is [[perpendicular to $b$|03NK6RSRQ1]].
Among all multiples $c b$ of $b$, the projection is the one that makes $\|a - c b\|$ smallest.
If $\theta$ is the angle between $a \neq 0$ and $b$, then the scalar projection is $\|a\| \cos \theta$.

## Explanations

### L1 human

The projection answers the question "how much of $a$ points along $b$?". For $a = (3, 4)$ and $b = (1, 0)$ the projection is $(3, 0)$. The rest, $(0, 4)$, is perpendicular to $b$.
