Applications of the scalar product

  • Magnitude of a vector.

    The scalar product can be used to determine the length of a vector $$\vec{u}$$ since: $$$\vec{u}\cdot\vec{u}=|\vec{u}||\vec{u}|\cos(\widehat{uu})=|\vec{u}|^2$$$

    from which: $$\vec{u}=\sqrt{\vec{u}\cdot\vec{u}}$$

    So, we obtain, using the coordinates of the vector $$\vec{u}=(u_1,u_2)$$, $$$ \vec{u}=\sqrt{u_1^2+u_2^2}$$$

For $$\vec{u}=(3,4)$$, we have that $$$|\vec{u}|=\sqrt{u_1^2+u_2^2}=\sqrt{3^2+4^2}=\sqrt{25}=5$$$

  • Angle between two vectors.

    From the definition of the scalar product, $$\vec{u}\cdot\vec{u}=|\vec{u}||\vec{u}|\cos(\widehat{uu})$$ we can convert the cosine to another value: $$$\cos(\widehat{uv})=\dfrac{\vec{u}\cdot\vec{v}}{|\vec{u}||\vec{v}|}$$$

    Applying the function arcosine to both sides of the equality we obtain (ang=angle): $$$ \text{ang}(\vec{u},\vec{v})=\arccos\Big(\dfrac{\vec{u}\cdot\vec{v}}{|\vec{u}||\vec{v}|}\Big)$$$

    So, if we have two vectors $$\vec{u}=(u_1,u_2)$$ and $$\vec{v}=(v_1,v_2)$$ we have:

    $$$ \text{ang}(\vec{u},\vec{v})=\text{ang}(\vec{v},\vec{u})=\arccos\Big(\dfrac{u_1 v_1+u_2 v_2}{\sqrt{u_1^2+u_2^2}\cdot\sqrt{v_1^2+v_2^2}}\Big)$$$

Find the angle formed by $$\vec{u}=(2,3)$$ and $$\vec{v}=(-1,4)$$. In this case, applying the previous formula, we obtain: $$$ \text{ang}(\vec{u},\vec{v})=\arccos\Big(\dfrac{2\cdot(-1)+3\cdot4} {\sqrt{2^2+3^2}\cdot\sqrt{(-1)^2+4^2}}\Big)= \arccos(0.67267)= 47^\circ43'35''$$$