Plane { public double dot(Vec3 vector) { if (vector == null) { throw new IllegalArgumentException(Logger.logMessage(Logger.ERROR, "Plane", "dot", "missingVector")); } return this.normal.dot(vector) + this.distance; } Plane();  Plane(double x, double y, double z, double distance);  Plane(Plane plane); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); double distanceToPoint(Vec3 point); Plane set(double x, double y, double z, double distance); Plane set(Plane plane); Plane transformByMatrix(Matrix4 matrix); double dot(Vec3 vector); boolean intersectsSegment(Vec3 endPoint1, Vec3 endPoint2); int onSameSide(Vec3 pointA, Vec3 pointB); Vec3[] clip(Vec3 pointA, Vec3 pointB);  }
@Test public void testDot() throws Exception { double distance = 6; Vec3 n = new Vec3(3, 4, 5).normalize(); Vec3 u = new Vec3(7, 8, 9); Plane plane = new Plane(n.x, n.y, n.z, distance); double expected = n.dot(u) + distance; double result = plane.dot(u); assertEquals("plane dot product", expected, result, 0); }