Java Simple Rotation Around Point

Vacationmansta

New Member
I'm trying to use this method to rotate a point:\[code\] AffineTransform at = AffineTransform.getRotateInstance(Math.toRadians(90), 1, 2); double[] pt = {0, 1}; at.transform(pt, 0, pt, 0, 1); int x = (int)pt[0]; int y = (int)pt[1];\[/code\]The expected result is \[code\]x=0\[/code\] and \[code\]y=3\[/code\] because we are rotating 90* clockwise, however the output is currently \[code\]x=2\[/code\] and \[code\]y=1\[/code\];Why am I not getting the expected result?
 
Top