3.6. Dot and cross products#

There are two ways in which we calculate the product of two vectors, these are known as the dot product and the cross product.

3.6.1. Dot product#

Definition 3.6 (The dot product)

The dot product (also known as the scalar product) of two vectors \(\vec{a}\) and \(\vec{b}\) in \(\mathbb{R}^n\), is defined by

(3.3)#\[ \vec{a} \cdot \vec{b} = \sum_{i=1}^n a_ib_i = a_1b_1 + a_2b_2 + \cdots + a_nb_n. \]

In \(\mathbb{R}^2\) and \(\mathbb{R}^3\) the dot product of two vectors \(\vec{a}\) and \(\vec{b}\), can be defined in geometric terms by

(3.4)#\[ \vec{a} \cdot \vec{b} = |\vec{a}| |\vec{b}| \cos(\theta), \]

where \(\theta\) is the angle between \(\vec{a}\) and \(\vec{b}\) (Fig. 3.9).

../_images/3_dot_product.svg

Fig. 3.9 The dot product \(\vec{a} \cdot \vec{b}\) is a scalar that is related to the angle between \(\vec{a}\) and \(\vec{b}\).#

From the definition of the dot product, we can observe the following:

  • the dot product produces is a scalar quantity (an element of \(\mathbb{R}\));

  • the dot product of two perpendicular vectors is zero, we write \(\vec{a}\perp\vec{b}\) if \(\vec{a}\cdot\vec{b}=0\);

  • the dot product of two co-directional (parallel) vectors \(\vec{a}\) and \(\vec{b}\) is equal to \(|\vec{a}| |\vec{b}|\).

Theorem 3.3 (Properties of the dot product)

For any vectors \(\vec{u},\vec{v},\vec{w}\) in \(\mathbb{R}^n\) and any scalar \(k\) in \(\mathbb{R}\):

  • the dot product is distributive over vector addition, i.e., \((\vec{u} + \vec{v})\cdot \vec{w} = \vec{u} \cdot \vec{w} + \vec{v} \cdot \vec{w}\);

  • for any scalar \(k\), \((k \vec{u})\cdot \vec{v} = \vec{u} \cdot (k \vec{v})= k (\vec{u} \cdot \vec{v})\);

  • the dot product is commutative, i.e., \(\vec{u} \cdot \vec{v} = \vec{v} \cdot \vec{u}\);

  • \(\vec{u} \cdot \vec{u} = |\vec{u}|^2 \geq 0 \text{ and } \vec{u} \cdot \vec{u} = 0 \iff \vec{u} = \vec{0}.\)

Example 3.4

Given the vectors \(\vec{u} = (1, 2, 3)^\mathsf{T}\) and \(\vec{v} = (3, -1, 0)^\mathsf{T}\). Calculate:

(i)   \(\vec{u} \cdot \vec{v}\);

Solution (click to show)

Using equation (3.3)

\[\begin{split} \begin{align*} \vec{u} \cdot \vec{v} = \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} \cdot \begin{pmatrix} 3 \\ -1 \\ 0 \end{pmatrix} = 1(3) + 2(-1) + 3(0) = 3 - 2 + 0 = 1 \end{align*} \end{split}\]

(ii)   the angle between \(\vec{u}\) and \(\vec{v}\).

Solution (click to show)

Using equation (3.4)

\[\begin{split} \begin{align*} \vec{u} \cdot \vec{v} &= |\vec{u}| |\vec{v}| \cos(\theta) \\ \therefore \theta &= \cos^{-1} \left( \frac{\vec{u} \cdot \vec{v}}{|\vec{u}||\vec{v}|}\right) \\ &= \cos^{-1} \left( \frac{1}{\sqrt{14}\sqrt{10}}\right) \approx 1.4862. \end{align*} \end{split}\]

Note: angles should be expressed in radians at all times.

3.6.1.1. Matrix multiplication revisited#

We have already seen that the multiplication of two matrices is defined by

\[ [AB]_{ij} = \sum_{k = 1}^n a_{ik}b_{kj}. \]

You may note that the term in the summation is similar to the dot product. In fact, when we multiply two matrices together we are calculating the dot product between the rows of the left-hand matrix and the columns of the right-hand matrix, i.e.,

\[ [AB]_{ij} = \vec{a}_i \cdot \vec{b}_j, \]

where \(\vec{a}_i\) is row \(i\) of \(A\) and \(\vec{b}_j\) is column \(j\) of \(B\).

3.6.2. The cross product#

Definition 3.7 (The cross product)

The cross product (also known as the vector product) of two vectors in \(\mathbb{R}^3\), \(\vec{a}=(a_1,a_2,a_3)^\mathsf{T}\) and \(\vec{b}=(b_1,b_2,b_3)^\mathsf{T}\) can be calculated using a determinant where

(3.5)#\[\begin{split}\vec{a} \times \vec{b} = \det \begin{pmatrix} \vec{i} & \vec{j} & \vec{k} \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{pmatrix}. \end{split}\]

and \(\vec{i} = (1, 0, 0)^\mathsf{T}\), \(\vec{j} = (0, 1, 0)^\mathsf{T}\) and \(\vec{k} = (0, 0, 1)^\mathsf{T}\). The cross product between two vectors \(\vec{a}\) and \(\vec{b}\) returns a vector that is perpendicular to both \(\vec{a}\) and \(\vec{b}\). Futhermore \(\vec{a} \times \vec{b} = -\vec{b} \times \vec{a}\), i.e., \(\vec{b} \times \vec{a}\) is a vector pointing in the exact opposite direction to \(\vec{a} \times \vec{b}\) (Fig. 3.10).

../_images/3_cross_product.svg

Fig. 3.10 The cross product \(\vec{a} \times \vec{b}\) is another vector perpendicular to both \(\vec{a}\) and \(\vec{b}\).#

Theorem 3.4 (Properties of the cross product)

The cross product has the following properties:

  • \(\vec{a}\times \vec{b}\) produces a vector in the same space as \(\vec{a}\) and \(\vec{b}\);

  • \(\vec{a}\times \vec{b}\) produces a vector that is perpendicular to both \(\vec{a}\) and \(\vec{b}\);

  • \(\vec{a} \times \vec{b} = -(\vec{b} \times \vec{a})\)   (i.e., there are two vectors perpendicular to \(\vec{a}\) and \(\vec{b}\) pointing in opposite directions);

  • if \(\vec{a}\) and \(\vec{b}\) are parallel vectors, then \(\vec{a}\times \vec{b} = \vec{0}\);

  • the self cross product of a vector is the zero vector, i.e., \(\vec{a} \times \vec{a} = \vec{0}\);

  • the cross product is not commutative, i.e., \(\vec{a} \times \vec{b} \neq \vec{b} \times \vec{a}\);

  • the cross product is distributive over addition, i.e., \(\vec{a} \times (\vec{b} + \vec{c}) = (\vec{a} \times \vec{b}) + (\vec{a} \times \vec{c})\);

  • the cross product is not associative, i.e., \(\vec{a} \times (\vec{b} \times \vec{c}) \neq (\vec{a} \times \vec{b}) \times \vec{c}\).

Example 3.5

Calculate the cross product between the vectors \(\vec{u} = (1, 2, 3)^\mathsf{T}\) and \(\vec{v} = (4, 5, 6)^\mathsf{T}\) and show that it is perpendicular to both \(\vec{u}\) and \(\vec{v}\).

Solution (click to show)
\[\begin{split} \begin{align*} \vec{u} \times \vec{v} &= \begin{vmatrix} \vec{i} & \vec{j} & \vec{k} \\ 1 & 2 & 3 \\ 4 & 5 & 6 \end{vmatrix} = (12 - 15)\vec{i} - (6 - 12) \vec{j} + (5 - 8) \vec{k} \\ &= -3\vec{i} + 6 \vec{j} - 3\vec{k} = \begin{pmatrix} -3 \\ 6 \\ -3 \end{pmatrix}. \end{align*} \end{split}\]

To show that \(\vec{u} \times \vec{v} \perp \vec{u}, \vec{v}\) we calculate the dot product

\[\begin{split} \begin{align*} \vec{u} \cdot (\vec{u} \times \vec{v}) &= \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} \cdot \begin{pmatrix} -3 \\ 6 \\ -3 \end{pmatrix} = -3 + 12 - 9 = 0, \\ \vec{v} \cdot (\vec{u} \times \vec{v}) &= \begin{pmatrix} 4 \\ 5 \\ 6 \end{pmatrix} \cdot \begin{pmatrix} -3 \\ 6 \\ -3 \end{pmatrix} = -12 + 30 - 18 = 0, \end{align*} \end{split}\]

therefore \(\vec{u} \times \vec{v}\) is perpendicular to both \(\vec{u}\) and \(\vec{v}\).