Skip to content

Commit f043043

Browse files
committed
fix: clang issues
1 parent f7cf5c4 commit f043043

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static List<int[]> generateCirclePoints(int centerX, int centerY, int rad
2727

2828
// Special case for radius 0, only the center point should be added.
2929
if (radius == 0) {
30-
points.add(new int[]{centerX, centerY});
30+
points.add(new int[] {centerX, centerY});
3131
return points;
3232
}
3333

@@ -72,13 +72,13 @@ public static List<int[]> generateCirclePoints(int centerX, int centerY, int rad
7272
*/
7373
private static void addSymmetricPoints(List<int[]> points, int centerX, int centerY, int x, int y) {
7474
// Octant symmetry points
75-
points.add(new int[] { centerX + x, centerY + y });
76-
points.add(new int[] { centerX - x, centerY + y });
77-
points.add(new int[] { centerX + x, centerY - y });
78-
points.add(new int[] { centerX - x, centerY - y });
79-
points.add(new int[] { centerX + y, centerY + x });
80-
points.add(new int[] { centerX - y, centerY + x });
81-
points.add(new int[] { centerX + y, centerY - x });
82-
points.add(new int[] { centerX - y, centerY - x });
75+
points.add(new int[] {centerX + x, centerY + y});
76+
points.add(new int[] {centerX - x, centerY + y});
77+
points.add(new int[] {centerX + x, centerY - y});
78+
points.add(new int[] {centerX - x, centerY - y});
79+
points.add(new int[] {centerX + y, centerY + x});
80+
points.add(new int[] {centerX - y, centerY + x});
81+
points.add(new int[] {centerX + y, centerY - x});
82+
points.add(new int[] {centerX - y, centerY - x});
8383
}
8484
}

src/test/java/com/thealgorithms/geometry/MidpointCircleTest.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ class MidpointCircleTest {
2323
*/
2424
@ParameterizedTest
2525
@CsvSource({
26-
"0, 0, 3", // Circle centered at (0, 0) with radius 3
27-
"10, 10, 2" // Circle centered at (10, 10) with radius 2
26+
"0, 0, 3", // Circle centered at (0, 0) with radius 3
27+
"10, 10, 2" // Circle centered at (10, 10) with radius 2
2828
})
29-
void testGenerateCirclePoints(int centerX, int centerY, int radius) {
29+
void
30+
testGenerateCirclePoints(int centerX, int centerY, int radius) {
3031
List<int[]> points = MidpointCircle.generateCirclePoints(centerX, centerY, radius);
3132

3233
// Ensure that all points satisfy the circle equation (x - centerX)^2 + (y - centerY)^2 = radius^2
@@ -38,8 +39,7 @@ void testGenerateCirclePoints(int centerX, int centerY, int radius) {
3839
int dy = y - centerY;
3940
int distanceSquared = dx * dx + dy * dy;
4041

41-
assertTrue(Math.abs(distanceSquared - radius * radius) <= 1,
42-
"Point (" + x + ", " + y + ") does not satisfy the circle equation.");
42+
assertTrue(Math.abs(distanceSquared - radius * radius) <= 1, "Point (" + x + ", " + y + ") does not satisfy the circle equation.");
4343
}
4444
}
4545

@@ -51,7 +51,6 @@ void testZeroRadiusCircle() {
5151
List<int[]> points = MidpointCircle.generateCirclePoints(0, 0, 0);
5252

5353
// A zero-radius circle should only have one point: (0, 0)
54-
assertTrue(points.size() == 1 && points.get(0)[0] == 0 && points.get(0)[1] == 0,
55-
"Zero-radius circle did not generate the correct point.");
54+
assertTrue(points.size() == 1 && points.get(0)[0] == 0 && points.get(0)[1] == 0, "Zero-radius circle did not generate the correct point.");
5655
}
5756
}

0 commit comments

Comments
 (0)