public class Point3d { public double x, y, z; public Point3d() { this(0.0,0.0,0.0); } public Point3d(double x, double y, double z) { this.x = x; this.y = y; this.z = z; } public String toString() { return "("+x+","+y+","+z+")"; } private static final double EPSILON = 0.000001; public static boolean coincident(Point3d p1, Point3d p2) { return Math.abs(p1.y-p2.y) < EPSILON && Math.abs(p1.x-p2.x) < EPSILON; } }