示例#1
0
 @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);
     }
   }
 }
示例#2
0
  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;
  }