public Point2D(double x,double y){
  if (Double.isInfinite(x) || Double.isInfinite(y))   throw new IllegalArgumentException("Coordinates must be finite");
  if (Double.isNaN(x) || Double.isNaN(y))   throw new IllegalArgumentException("Coordinates cannot be NaN");
  if (x == 0.0)   this.x=0.0;
 else   this.x=x;
  if (y == 0.0)   this.y=0.0;
 else   this.y=y;
}

public Point2D ( double x , double y ) { if ( Double . isInfinite ( x ) || Double . isInfinite ( y ) ) throw new IllegalArgumentException ( "Coordinates must be finite" ) ; if ( Double . isNaN ( x ) || Double . isNaN ( y ) ) throw new IllegalArgumentException ( "Coordinates cannot be NaN" ) ; if ( x == 0.0 ) this . x = 0.0 ; else this . x = x ; if ( y == 0.0 ) this . y = 0.0 ; else this . y = y ; }
initializes a new point ( x , y ) .
