The most common answer in the internet refers to the calculation of the acute angle between two vectors using the formula below:

\( \cos \theta=  \dfrac{u \centerdot v}{\text{\textbardbl}u\text{\textbardbl} \text{\textbardbl}v\text{\textbardbl}}\)

This calculation does not provide with the sign of the angle between two vectors. For instance, you could be interested in calculating the angle measured only in the clockwise direction. Also, this can be adapted to get the angle from 0 to 360 degrees.

Play with the code here:

p5.js Web Editor
A web editor for p5.js, a JavaScript library with the goal of making coding accessible to artists, designers, educators, and beginners.