= Dot product
{title2=$\mathbf a\cdot\mathbf b$}
{wiki}
= Scalar product
{synonym}
= Euclidean inner product
{synonym}
A <dot product> measures how much two <Euclidean vectors> point along each other. This article uses real <Euclidean vectors> in $\mathbb R^n$, with the usual <Cartesian basis>: multiply matching coordinates and add,
$$
\mathbf a\cdot\mathbf b=\sum_{i=1}^n a_i b_i,\qquad
\|\mathbf a\|=\sqrt{\mathbf a\cdot\mathbf a}.
$$
The result is a <scalar>, while $\|\mathbf a\|$ is the <Euclidean norm>. This real convention has no <complex conjugation>; for <vectors> over the <complex numbers>, use the convention specified in <inner product>.
For two nonzero <Euclidean vectors>, the same <dot product> records their <angle> $0\leq\theta\leq\pi$ through the <cosine>:
$$
\mathbf a\cdot\mathbf b=\|\mathbf a\|\|\mathbf b\|\cos\theta,\qquad
\theta=\arccos\frac{\mathbf a\cdot\mathbf b}{\|\mathbf a\|\|\mathbf b\|}.
$$
Here $\arccos$ is an <inverse trigonometric function>. The <Cauchy-Schwarz inequality> guarantees that the normalized ratio lies in $[-1,1]$. The <zero vector> has <dot product> zero with every <vector>, but its <angle> is undefined: the ratio would divide by zero. To outline the geometric identity, expand $\|\mathbf a-\mathbf b\|^2=\|\mathbf a\|^2+\|\mathbf b\|^2-2\mathbf a\cdot\mathbf b$ and compare with the <law of cosines>.https://openstax.org/books/calculus-volume-3/pages/2-3-the-dot-product[OpenStax, Calculus Volume 3, §2.3: the dot product and angles]{ref}
Take $\mathbf a=(3,4)$ and $\mathbf c=(2,0)$. Their <Euclidean norms> are $5$ and $2$, and
$$
\mathbf a\cdot\mathbf c=3(2)+4(0)=6,\qquad
\cos\theta=\frac{6}{5\cdot2}=\frac35,\qquad
\theta=\arccos(3/5)\approx53.1301^\circ.
$$
The <unit vector> $\mathbf u=\mathbf c/\|\mathbf c\|=(1,0)$ selects the horizontal direction. The <scalar projection> $\mathbf a\cdot\mathbf u=3$ says how far $\mathbf a$ reaches along that direction; its <vector projection> is $3\mathbf u=(3,0)$. Thus $\mathbf a=(3,0)+(0,4)$ splits into an aligned part and an <orthogonal projection residual>.
\Image[/dot-product-projection-and-angle.png]
{title=The <vector projection> of $(3,4)$ onto the horizontal line is $(3,0)$; the <orthogonal projection residual> is $(0,4)$ and the <angle> is $53.1301^\circ$}
For $\mathbf b=(4,-3)$, the <dot product> $\mathbf a\cdot\mathbf b=12-12=0$ proves <orthogonality>; both <Euclidean norms> are $5$. For $\mathbf d=(-2,0)$, $\mathbf a\cdot\mathbf d=-6$: the <scalar projection> onto $\mathbf d/\|\mathbf d\|=(-1,0)$ is $-3$, because $\mathbf a$ reaches against that chosen direction. Its <angle> with $\mathbf d$ is $126.8699^\circ$.
Keeping $\mathbf a=(3,4)$ fixed and choosing $\mathbf b$ of <Euclidean norm> $2$ gives $\mathbf a\cdot\mathbf b=10\cos\theta$. At <angles> $0^\circ,60^\circ,90^\circ,120^\circ,180^\circ$, the <dot products> are $10,5,0,-5,-10$. Positive values mean partial alignment, zero means <orthogonality>, and negative values mean a component against the other direction.
\Image[/dot-product-angle-sign.png]
{title=With <Euclidean norms> $5$ and $2$, the <dot product> follows $10\cos\theta$; equal-length arrows show positive, zero, and negative alignment with $(3,4)$}
This interpretation explains <work>: for a constant <force> $\mathbf F$ and a straight <displacement> $\mathbf s$, $W=\mathbf F\cdot\mathbf s$ counts the <force> component along the motion. A sideways <force> contributes zero <work>, and an opposing <force> contributes negative <work>.https://openstax.org/books/calculus-volume-3/pages/2-3-the-dot-product[OpenStax, §2.3: work]{ref}
Back to article page