diff --git a/src/main/java/eu/jonahbauer/raytracing/math/Vec3.java b/src/main/java/eu/jonahbauer/raytracing/math/Vec3.java index adbfbb4..76c8d41 100644 --- a/src/main/java/eu/jonahbauer/raytracing/math/Vec3.java +++ b/src/main/java/eu/jonahbauer/raytracing/math/Vec3.java @@ -11,9 +11,7 @@ public record Vec3(double x, double y, double z) { public static final Vec3 UNIT_Z = new Vec3(0, 0, 1); public Vec3 { - if (!Double.isFinite(x) || !Double.isFinite(y) || !Double.isFinite(z)) { - throw new IllegalArgumentException("x, y and z must be finite"); - } + assert Double.isFinite(x) && Double.isFinite(y) && Double.isFinite(z) : "x, y and z must be finite"; } public static @NotNull Vec3 random() {