Skip to content

Commit 9d7937d

Browse files
committed
feat: added rotating calipers
1 parent a39d18f commit 9d7937d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/main/java/com/thealgorithms/geometry/RotatingCalipers.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,8 @@ public static Rectangle minAreaBoundingRectangle(List<Point> points) {
146146
minArea = area;
147147
bestWidth = width;
148148
bestHeight = height;
149-
bestCorners = new Point[] {
150-
new Point((int)(ux * minU + vx * minV), (int)(uy * minU + vy * minV)),
151-
new Point((int)(ux * maxU + vx * minV), (int)(uy * maxU + vy * minV)),
152-
new Point((int)(ux * maxU + vx * maxV), (int)(uy * maxU + vy * maxV)),
153-
new Point((int)(ux * minU + vx * maxV), (int)(uy * minU + vy * maxV))
154-
};
149+
bestCorners = new Point[] {new Point((int) (ux * minU + vx * minV), (int) (uy * minU + vy * minV)), new Point((int) (ux * maxU + vx * minV), (int) (uy * maxU + vy * minV)), new Point((int) (ux * maxU + vx * maxV), (int) (uy * maxU + vy * maxV)),
150+
new Point((int) (ux * minU + vx * maxV), (int) (uy * minU + vy * maxV))};
155151
}
156152
}
157153

0 commit comments

Comments
 (0)