Skip to content

Commit 796cfe1

Browse files
authored
Simplify exception throwing for total internal reflection
1 parent 0d7efd2 commit 796cfe1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/com/thealgorithms/physics/SnellLaw.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ public static double refractedAngle(double n1, double n2, double theta1) {
2525
double sinTheta2 = ratio * Math.sin(theta1);
2626

2727
if (Math.abs(sinTheta2) > 1.0) {
28-
throw new IllegalArgumentException(
29-
"Total internal reflection: no refraction possible."
30-
);
28+
throw new IllegalArgumentException("Total internal reflection: no refraction possible.");
3129
}
3230

3331
return Math.asin(sinTheta2);

0 commit comments

Comments
 (0)