Brain Dump

Dot Product

Tags
math

Is a transformation of two n-sized vectors into a real-valued number.

We can define the dot-product between 2 vectors as the summation of the multiplication of each element in the vectors zipped together.

\begin{align} \label{eq:dotproduct-sum} \vec{a} \cdot \vec{b} = \sum_^{n} a_i \times b_i \end{align}

We can also define the dot-product of two vectors as a measure of the angle between them.

\begin{align} \label{eq:dotproduct-cosine} \cos \theta = \frac{\vec{d_1} \cdot \vec{d_2}}{|\vec{d_1}| |\vec{d_2}|} \end{align}

Note: When 2 vectors are perpendicular to each other they have an angle of \( 90^{\degree} \) between them. \( \cos 90^{\degree} = 0 \) meaning the dot product of these two lines must be \( 0 \).

\begin{figure}[ht]
  \centering
  \begin{tikzpicture}[scale=2]
    \draw[very thick,->]  (0,0) -- (1, {tan(30)}) node[right] {\( d_1 \)};
    \draw[very thick,->]  (0,0) -- (1, {-tan(45)}) node[right] {\( d_2 \)};
    \draw (30:.3) arc  (30:-45:.3) node[midway,left] {\( \theta \)};
  \end{tikzpicture}
  \caption{Two vectors, \( d_1 \) and \( d_2 \), with an angle between them \( \theta \).}
\end{figure}

Links to this note