Dot product in the plane

Given a pair of 2D vectors:
 * $$ \vec u = (u_x, u_y) $$
 * $$ \vec v = (v_x, v_y) $$

Then their dot product is
 * $$ \vec u \cdot \vec v := u_x v_x + u_y v_y$$.

Suppose that $$\vec u$$ and $$\vec v$$ are both rotated by an angle $$\theta$$:
 * $$\begin{pmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta\end{pmatrix} \begin{pmatrix} u_x \\ u_y\end{pmatrix} = \begin{pmatrix} u_x \cos \theta - u_y \sin \theta \\ u_x \sin \theta + u_y \cos \theta\end{pmatrix} = \begin{pmatrix} u_x' \\ u_y' \end{pmatrix} $$


 * $$\begin{cases} u_x' = u_x \cos \theta - u_y \sin \theta \\ u_y' = u_x \sin \theta + u_y \cos \theta \end{cases} $$
 * $$\begin{cases} v_x' = v_x \cos \theta - v_y \sin \theta \\ v_y' = v_x \sin \theta + v_y \cos \theta \end{cases}$$


 * $$ \vec u' \cdot \vec v' = u_x' v_x' + u_y' v_y' $$
 * $$ = (u_x \cos \theta - u_y \sin \theta) (v_x \cos \theta - v_y \sin \theta) + (u_x \sin \theta + u_y \cos \theta) (v_x \sin \theta + v_y \cos \theta) $$
 * $$ = u_x v_x \cos^2 \theta - u_x v_y \cos \theta \sin \theta - u_y v_x \sin \theta \cos \theta + u_y v_y \sin^2 \theta $$
 * $$+ u_x v_x \sin^2 \theta + u_x v_y \sin \theta \cos \theta + u_y v_x \cos \theta \sin \theta + u_y v_y \cos^2 \theta $$
 * $$ = u_x v_x (\cos^2 \theta + \sin^2 \theta) + u_y v_y (\cos^2 + \sin^2 \theta) $$
 * $$ = u_x v_x + u_y v_y = \vec u \cdot \vec v$$

applying the trigonometric form of the Pythagorean Theorem (i.e., $$\cos^2 \theta + \sin^2 \theta = 1$$).

So if $$\vec u$$ and $$\vec v$$ are both rotated with the angle between them preserved then their dot product is preserved as well.

Multiplying lengths of $$\vec u$$ and $$\vec v$$. Let $$\vec u' = \lambda \vec u$$, $$\vec v' = \mu \vec v$$. I.e.,
 * $$ \vec u' = (\lambda u_x, \lambda u_y)$$,
 * $$ \vec v' = (\mu v_x, \mu v_y)$$.

Then
 * $$ \vec u' \cdot \vec v' = \lambda \mu u_x v_x + \lambda \mu u_y v_y$$
 * $$ = \lambda \mu (u_x v_x + u_y v_y) = \lambda \mu \, \vec u \cdot \vec v$$.

Multiplying the length of $$\vec u$$ or $$\vec v$$ also multiplies the length of the dot product $$\vec u \cdot \vec v$$ by the same factor. (This property is called homogeneity, or linearity.)

What happens when $$\hat u$$ and $$\hat v$$ are unit vectors? Rotate both of them (by the same angle) until one of them equals the vector (1, 0). Suppose that $$\hat u' = (1, 0)$$. Then $$\hat v' = (v_x', v_y')$$,
 * $$ \hat u' \cdot \hat v' = v_x'$$.

Let $$\phi$$ be the angle between $$\hat u'$$ and $$\hat v'$$ (or between $$\hat u$$ and $$\hat v$$, equivalently).
 * $$ \cos \phi = {v_x' \over 1} = v_x'$$

so $$\hat u' \cdot \hat v' = \cos \phi = \hat u \cdot \hat v$$

For any vectors $$\vec u,\ \vec v$$ which are not unit vectors, let
 * $$ \vec u = u \hat u$$,
 * $$ \vec v = v \hat v$$

where $$u = \sqrt{\vec u \cdot \vec u}$$ is the magnitude (or length) of vector $$\vec u$$ (by the Pythagorean Theorem) and $$v = \sqrt{\vec v \cdot \vec v}$$ likewise, and where $$\hat u$$ is a unit vector in the same direction as $$\vec u$$; and $$\hat v$$ is a unit vector in the same direction as $$\vec v$$.

So
 * $$ \vec u \cdot \vec v = u \hat u \cdot v \hat v = u v (\hat u \cdot \hat v) $$
 * $$ \vec u \cdot \vec v = u v \cos \phi $$

where $$\phi$$ is the angle between $$\hat u$$ and $$\hat v$$ (or equivalently, between $$\vec u$$ and $$\vec v$$). This last equation denotes the geometric interpretation of the dot product (as being proportional to the magnitudes of the vectors and the cosine of the angle between them).