How can I find the angle (0 to 360 degrees, rotating clockwise) between 0,1
and another point (in the following diagram, 0.3,-0.17
), with the origin at 0,0
? Here's a somewhat crudely drawn illustration of what I need:
The circle on the left is purely for showing which direction I want the angles to rotate, and from where they start/end. The drawing on the right gives an example of the input I would supply to the code (i.e., 0.3,-0.17
). The green line is resulting angle.
How do I find the angle between two points, as described above, in C++ or JavaScript?