# The Dot Product

## Key Questions

• That's very simple, I'll show you how,
Let,
A + B = C

Thus, one may write,
C. C = (A + B).(A + B)
this implies, that
${C}^{2} = {A}^{2} + {B}^{2} + 2 A B C o s \theta$

Thus we get,
$C = {\left[{A}^{2} + {B}^{2} + 2 A B C o s \theta\right]}^{\frac{1}{2}}$

This, is the law of cosines.

• The dot product of two vectors is a quite interesting operation because it gives, as a result, a...SCALAR (a number without vectorial properties)!

As a definition you have:

Given two vectors $\vec{v}$ and $\vec{w}$ the dot product is given by:

$\vec{v} \cdot \vec{w} = | \vec{v} | \cdot | \vec{w} | \cdot \cos \left(\theta\right)$

i.e. is equal to the product of the modules of the two vectors times de cosine of the angle between them.

For example:
if $| \vec{v} | = 10$ and $| \vec{w} | = 5$ and theta =60°
vecv*vecw=|vecv|*|vecw|*cos(theta)=10*5*cos(60°)=25

Another way of calculating the dot product is to use the coordinates of the vectors:
If you have:
$\vec{v} = a \vec{i} + b \vec{j} + c \vec{k}$ and $\vec{w} = \mathrm{dv} e c i + e \vec{j} + f \vec{k}$
(where $a , b , c , d , e \mathmr{and} f$ are real numbers)
you can write:
$\vec{v} \cdot \vec{w} = \left(a \cdot d\right) + \left(b \cdot e\right) + \left(c \cdot f\right)$
For example:
if:
$\vec{v} = 3 \vec{i} + 5 \vec{j} - 3 \vec{k}$ and $\vec{w} = - 1 \vec{i} + 2 \vec{j} + 3 \vec{k}$
$\vec{v} \cdot \vec{w} = \left(3 \cdot - 1\right) + \left(5 \cdot 2\right) + \left(- 3 \cdot 3\right) =$
$= - 3 + 10 - 9 = - 2$

This operation has important practical applications. For example in Physics the dot product of Force (a vector) and displacement (a vector) gives as a result a number without vectorial characteristics, called, Work.

• The cross product is used primarily for 3D vectors. It is used to compute the normal (orthogonal) between the 2 vectors if you are using the right-hand coordinate system; if you have a left-hand coordinate system, the normal will be pointing the opposite direction. Unlike the dot product which produces a scalar; the cross product gives a vector.

The cross product is not commutative, so $\vec{u} \times \vec{v} \ne \vec{v} \times \vec{u}$. If we are given 2 vectors: $\vec{u} = \left\{{u}_{1} , {u}_{2} , {u}_{3}\right\}$ and $\vec{v} = \left\{{v}_{1} , {v}_{2} , {v}_{3}\right\}$, then the formula is:

$\vec{u} \times \vec{v} = \left\{{u}_{2} \cdot {v}_{3} - {u}_{3} \cdot {v}_{2} , {u}_{3} \cdot {v}_{1} - {u}_{1} \cdot {v}_{3} , {u}_{1} \cdot {v}_{2} - {u}_{2} \cdot {v}_{1}\right\}$

If you have learnt calculating determinants, you will notice that the formula looks a lot like cofactor expansion of the first row; only you don't add up the terms, the terms become the components of the normal. This is one way to remember how to generate the formula for cross product. This is why the middle component is negated in the example.