In my code, I create an instance of java.awt.Rectangle
with a corner and length and width. Then I apply a rotation affine transformation(at) on it to rotate it by a certain angle.
Then I fetch rectangle's PathIterator and iterate the geometry as:
PathIterator i = rectangle.getPathIterator(at);
while (!i.isDone()) {
double[] xy = new double[2];
i.currentSegment(xy);
}
While I expect 4 points(or 5 as first and last may be same), what I get is 6 points. And more surprising is that last point is always (0,0). (0,0) is not part of rectangle geometry, but I still get it always. What is the reason behind this behaviour?