// construct a plane from three coplanar points public Plane(MVVector point0, MVVector point1, MVVector point2) { MVVector edge1 = point1.minus(point0); MVVector edge2 = point2.minus(point0); normal = MVVector.cross(edge1, edge2); normal.normalize(); d = -normal.dotProduct(point0); }
// provide a version of the constructor that handles integer Points public Plane(Point intPoint0, Point intPoint1, Point intPoint2) { MVVector point0 = new MVVector(intPoint0); MVVector point1 = new MVVector(intPoint1); MVVector point2 = new MVVector(intPoint2); MVVector edge1 = point1.minus(point0); MVVector edge2 = point2.minus(point0); normal = MVVector.cross(edge1, edge2); normal.normalize(); d = -normal.dotProduct(point0); }