$$ \vec{a} \cdot \vec{b}=\|\vec{a}\|\|\vec{b}\| \cos \theta $$
$$ \cos \theta=\frac{\vec{a} \cdot \vec{b}}{\|\vec{a}\|\|\vec{b}\|} $$
对于单位向量,模都是 1,因此可以化简成:
$$ \cos \theta=\hat{a} \cdot \hat{b} $$
符合交换律、结合律、分配律
$$ \vec{a} \cdot \vec{b}=\vec{b} \cdot \vec{a} \\ $$
$$ \vec{a} \cdot(\vec{b}+\vec{c})=\vec{a} \cdot \vec{b}+\vec{a} \cdot \vec{c} $$
$$ (k \vec{a}) \cdot \vec{b}=\vec{a} \cdot(k \vec{b})=k(\vec{a} \cdot \vec{b}) $$
Component-wise multiplication, then adding up
In 2D
$$ \vec{a} \cdot \vec{b}=\left(\begin{array}{l}x_{a} \\y_{a}\end{array}\right) \cdot\left(\begin{array}{l}x_{b} \\y_{b}\end{array}\right)=x_{a} x_{b}+y_{a} y_{b} $$
In 3D
$$ \vec{a} \cdot \vec{b}=\left(\begin{array}{c}x_{a} \\y_{a} \\z_{a}\end{array}\right) \cdot\left(\begin{array}{c}x_{b} \\y_{b} \\z_{b}\end{array}\right)=x_{a} x_{b}+y_{a} y_{b}+z_{a} z_{b} $$