I am trying to find a method which will rotate an object to make it face a specified point, however the numbers I am getting don't make much sense and I don't think I understand what the math methods are returning.
Here is my code:
public void rotate(double x, double y) {
rotateRight(Math.toDegrees(Math.atan2((x - getX()), (y - getY()))));
}
x and y are the specified point and getX() and getY() are the objects current point, so I am trying to find the number of degrees that object has to turn right to be facing the specified point.
Can anyone recommend a reliable way to do this?