public boolean contains(double x,double y){
  double ellw=getWidth();
  if (ellw <= 0.0) {
    return false;
  }
  double normx=(x - getX()) / ellw - 0.5;
  double ellh=getHeight();
  if (ellh <= 0.0) {
    return false;
  }
  double normy=(y - getY()) / ellh - 0.5;
  double distSq=(normx * normx + normy * normy);
  if (distSq >= 0.25) {
    return false;
  }
  double angExt=Math.abs(getAngleExtent());
  if (angExt >= 360.0) {
    return true;
  }
  boolean inarc=containsAngle(-Math.toDegrees(Math.atan2(normy,normx)));
  if (type == PIE) {
    return inarc;
  }
  if (inarc) {
    if (angExt >= 180.0) {
      return true;
    }
  }
 else {
    if (angExt <= 180.0) {
      return false;
    }
  }
  double angle=Math.toRadians(-getAngleStart());
  double x1=Math.cos(angle);
  double y1=Math.sin(angle);
  angle+=Math.toRadians(-getAngleExtent());
  double x2=Math.cos(angle);
  double y2=Math.sin(angle);
  boolean inside=(Line2D.relativeCCW(x1,y1,x2,y2,2 * normx,2 * normy) * Line2D.relativeCCW(x1,y1,x2,y2,0,0) >= 0);
  return inarc ? !inside : inside;
}

public boolean contains ( double x , double y ) { double ellw = getWidth ( ) ; if ( ellw <= 0.0 ) { return false ; } double normx = ( x - getX ( ) ) / ellw - 0.5 ; double ellh = getHeight ( ) ; if ( ellh <= 0.0 ) { return false ; } double normy = ( y - getY ( ) ) / ellh - 0.5 ; double distSq = ( normx * normx + normy * normy ) ; if ( distSq >= 0.25 ) { return false ; } double angExt = Math . abs ( getAngleExtent ( ) ) ; if ( angExt >= 360.0 ) { return true ; } boolean inarc = containsAngle ( - Math . toDegrees ( Math . atan2 ( normy , normx ) ) ) ; if ( type == PIE ) { return inarc ; } if ( inarc ) { if ( angExt >= 180.0 ) { return true ; } } else { if ( angExt <= 180.0 ) { return false ; } } double angle = Math . toRadians ( - getAngleStart ( ) ) ; double x1 = Math . cos ( angle ) ; double y1 = Math . sin ( angle ) ; angle += Math . toRadians ( - getAngleExtent ( ) ) ; double x2 = Math . cos ( angle ) ; double y2 = Math . sin ( angle ) ; boolean inside = ( Line2D . relativeCCW ( x1 , y1 , x2 , y2 , 2 * normx , 2 * normy ) * Line2D . relativeCCW ( x1 , y1 , x2 , y2 , 0 , 0 ) >= 0 ) ; return inarc ? ! inside : inside ; }
determines whether or not the specified point is inside the boundary of the arc .
