I'm trying to write in java a function which finds the angles, in degrees, between 2 vectors, according to the follow equation –
$$\cos{\theta} = \frac{\vec{u} \cdot \vec{v}}{\|\mathbf{u}\|\|\mathbf{v}\|}$$
but in java the Math.acos
method returns the angle radians, so what I have to do after I calculate $\frac{\vec{u} \cdot \vec{v}}{\|\mathbf{u}\|\|\mathbf{v}\|}$, to get it in degrees?
Best Answer
After calculating the value in radians, simply multiply by $\frac {180}{\pi}$ to convert it into degrees.