Skip to content

Commit cdac957

Browse files
author
Moksedur Rahman Sohan
committed
style: Format code with clang-format for consistency
1 parent c60c1cf commit cdac957

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/main/java/com/thealgorithms/lineclipping/CohenSutherland.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ public class CohenSutherland {
2424

2525
// Region codes for the 9 regions
2626
final int INSIDE = 0; // 0000
27-
final int LEFT = 1; // 0001
28-
final int RIGHT = 2; // 0010
27+
final int LEFT = 1; // 0001
28+
final int RIGHT = 2; // 0010
2929
final int BOTTOM = 4; // 0100
30-
final int TOP = 8; // 1000
30+
final int TOP = 8; // 1000
3131

3232
// Define the clipping window
3333
double xMin, yMin, xMax, yMax;

src/main/java/com/thealgorithms/lineclipping/LiangBarsky.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ private double[] clipLine(double[] p, double[] q) {
6666
if (t < t1) t1 = t; // Update t1
6767
}
6868
}
69-
return new double[]{t0, t1}; // Return valid t0 and t1
69+
70+
return new double[] {t0, t1}; // Return valid t0 and t1
7071
}
7172

7273
// calculate the clipped line based on t0 and t1

src/test/java/com/thealgorithms/lineclipping/CohenSutherlandTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.thealgorithms.lineclipping;
22

3+
import static org.junit.jupiter.api.Assertions.*;
4+
35
import com.thealgorithms.lineclipping.utils.Line;
46
import com.thealgorithms.lineclipping.utils.Point;
57
import org.junit.jupiter.api.Test;
68

7-
import static org.junit.jupiter.api.Assertions.*;
8-
99
/**
1010
* @author shikarisohan
1111
* @since 10/4/24

src/test/java/com/thealgorithms/lineclipping/LiangBarskyTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.thealgorithms.lineclipping;
22

3+
import static org.junit.jupiter.api.Assertions.*;
4+
35
import com.thealgorithms.lineclipping.utils.Line;
46
import com.thealgorithms.lineclipping.utils.Point;
57
import org.junit.jupiter.api.Test;
68

7-
import static org.junit.jupiter.api.Assertions.*;
8-
99
/**
1010
* @author shikarisohan
1111
* @since 10/5/24
@@ -60,5 +60,4 @@ void testVerticalLineClipping() {
6060
assertNotNull(clippedLine, "Line should not be null.");
6161
assertEquals(expectedClippedLine, clippedLine, "Vertical line should be clipped correctly.");
6262
}
63-
6463
}

0 commit comments

Comments
 (0)