@Override public void paint(Graphics g) { super.paint(g); for (Point p : points) { p.draw(g); } if (edges != null) { for (Edge e : edges) { e.draw(g); } } }
public double distance(Point one, Point two) { double delta_x = one.getX() - two.getX(); double delta_y = one.getY() - two.getY(); double delta_z = one.getZ() - two.getZ(); double distance = Math.sqrt(delta_x * delta_x + delta_y * delta_y + delta_z * delta_z); return distance; }