##### Definition:

The dot product (also called the inner product or scalar product) of two vectors is defined as:

#### Formula :

→ →
a . b = │ a │.│ b │ cos θ
**Where, **
|A| and |B| represents the magnitudes of vectors A and B theta is the angle between vectors A and B.
#### Dot product calculation :

The dot or scalar product of vectors A = a_{1} i + a_{2} j and B = b_{1} i + b_{2} j can be written as
A . B = a_{1} . b_{1} + a_{2 }. b_{2}
##### Example (calculation in two dimensions):

Vectors A and B are given by A = 5_{i } + 2_{j} and B = 3_{i } + 4_{j}. Find the dot product of the two vectors.

##### Solution:

A . B = (5_{i } + 2_{j} ) . ( 3_{i } + 4_{j} )
A . B = 5 . 3 + 2 . 4
A . B = 23

##### Example (calculation in three dimensions):

Vectors A and B are given by A = 4_{i } + 2_{j} + 1_{k}and B = 5_{i } + 4_{j}+ 2_{k}. Find the dot product of the two vectors.

##### Solution:

A . B = (4_{i } + 2_{j}+ 1_{k} ) . ( 5_{i } + 4_{j}+ 2_{k} )
A . B = 4 . 5 + 2 . 4 + 1 . 2
A . B = 30

##### Example ( The angle between two vectors : )

Vectors A and B are given by A = 5_{i } + 4_{j} - 3_{k}and B = -3_{i } + 2_{j}- 1_{k}. Find the angle between two vectors A and B.

##### Solution:

A . B = ( 5_{i } + 4_{j} - 3_{k} ) . ( -3_{i } + 2_{j}- 1_{k} )
a . b = 5.(-3) + 4.(2) + (-3).(-1) = -15+8+3 = -4
|a| = √(5^{2} + 4^{2} + (-3)^{2}) = √50
|b| = √(-3^{2} + (2)^{2} + (-1)^{2}) = √14
a . b = │ a │.│ b │ cos θ
cos θ = -4 / √50 √14
θ = cos^{-1}(-0.151185789)
θ = 98.695651011