When rotating a point around another point in 2D space, the rotated point is farther away from the rotation center than the original one.
I'm basically using Nil's answer from: Rotating a point about another point (2D)
public static Point2D.Double rotate_point(double cx, double cy, double angle, Point2D.Double p) {
double rad = Math.toRadians(angle);
double s = Math.sin(rad);
double c = Math.cos(rad);
// translate point back to origin:
p.x -= cx;
p.y -= cy;
// rotate point
double xnew = p.x * c - p.y * s;
double ynew = p.x * s + p.y * c;
// translate point back:
p.x = xnew + cx;
p.y = ynew + cy;
return p;
}
Rotating (-1594,6290) around (-1759,6963) gives (-1086.0 7128.0).
I plotted it with http://www.shodor.org/interactivate/activities/SimplePlot/
-1759,6963
-1594,6290
-1086.0 7128.0
It is obviously wrong, but i can't see why.
Rotating (2,0) around the origin returns (0,2) just fine.
Same with (2,1) around (0,1) => (0,3)