Write the vectors in component form: ( mathbf{a} = langle a_1, a_2, dots, a_n rangle ), ( mathbf{b} = langle b_1, b_2, dots, b_n rangle )
Multiply corresponding components: ( a_1 b_1, a_2 b_2, dots, a_n b_n )
Add the products: ( mathbf{a} cdot mathbf{b} = a_1 b_1 + a_2 b_2 + dots + a_n b_n )
For 2D vectors: ( langle x_1, y_1 rangle cdot langle x_2, y_2 rangle = x_1 x_2 + y_1 y_2 )
For 3D vectors: ( langle x_1, y_1, z_1 rangle cdot langle x_2, y_2, z_2 rangle = x_1 x_2 + y_1 y_2 + z_1 z_2 )
Use the angle formula if needed: ( mathbf{a} cdot mathbf{b} = |mathbf{a}| |mathbf{b}| cos theta )
Check that both vectors have the same number of components before computing the dot product
