The **dot product** or **scalar product** (not to be confused with cross product) of two vectors is the product of the magnitudes
of the two vectors and the cosine of the angle between them. The dot product of
vectors \(\vec{V}\) and \(\vec{U}\) can be calculated thanks to the following
formula:

$$ \vec{V} \cdot \vec{U} = V_x.U_x + V_y.U_y + V_z.U_z = | \vec{V} |. | \vec{U} | .cos (\theta) $$

where \(\theta\) is the angle between \(\vec{V}\) and \(\vec{U}\).

If \(\vec{V}\) and \(\vec{U}\) are perpendicular, \(\vec{V} \cdot \vec{U}\) is equal to zero. |

If \(\vec{V}\) is null, \(\vec{V} \cdot \vec{U}\) is equal to zero. |

If \(\vec{U}\) is null, \(\vec{V} \cdot \vec{U}\) is equal to zero. |

\(\vec{V} \cdot \vec{V} = | \vec{V} | ^2\) |

\(\vec{V} \cdot \vec{U} = \vec{U} \cdot \vec{V}\) |

\(\vec{V} \cdot (-\vec{U}) = (-\vec{V}) \cdot \vec{U} = - ( \vec{V} \cdot \vec{U} )\) |

The following C++ function return the dot product of two vectors :

```
/*!
* \brief Compute the dot product of two vectors (this . V)
* The current vector is the first operand
* \param V is the second operand
* \return the dot product between the current vector and V
*/
inline double rOc_vector::dot(const rOc_vector V)
{
return this->x()*V.x() + this->y()*V.y() + this->z()*V.z();
}
```

With MATLAB, the dot product can easily be computed with the function `dot(A, B)`

:

```
>> u=[1,2,3];
>> v=[4,5,6];
>> dot (u,v)
ans =
32
```

- Calculating the transformation between two set of points
- Catmull-Rom splines
- Check if a number is prime online
- Check if a point belongs on a line segment
- Cross product
- Common derivatives rules
- Common derivatives
- How to calculate the intersection points of two circles
- How to check if four points are coplanar?
- Common integrals (primitive functions)
- Least square approximation with a second degree polynomial
- Least-squares fitting of circles
- Least-squares fitting of sphere
- The mathematics behind PCA
- Online quadratic equation solver
- Online square root simplifyer
- Sines, cosines and tangeantes of common angles
- Singular value decomposition (SVD) of a 2×2 matrix
- Tangent line segments to circles
- Understanding covariance matrices
- Weighted PCA

Last update : 03/13/2022