I am struggling with this in JavaScript, but this problem applies to many other languages/environments as well.
I want to have one object rotating towards the position o
If you want the angle to increase clockwise from 0 on the y axis, calculate the angle as atan2(x,y). This however give negative angles for x<0, so you should add 2*pi in this case.