docs: @Pure
  	public double distance(Point2D<?, ?> point, double width) {
  		double mind = Double.POSITIVE_INFINITY;
  		double dist;
  		double w = width;
  		w = Math.abs(w) / 2.;
  
  		Point2d previousPoint;
  		Point2d currentPoint;
  		Iterator<Point2d> points;
  		boolean treatFirstPoint;
  
  		for (final PointGroup grp : groups()) {
  			previousPoint = null;
  			treatFirstPoint = false;
  			points = grp.iterator();
  			while (points.hasNext()) {
  				currentPoint = points.next();
  				if (previousPoint != null) {
  					treatFirstPoint = true;
  					dist = Segment2afp.calculatesDistanceSegmentPoint(
  							previousPoint.getX(), previousPoint.getY(),
  							currentPoint.getX(), currentPoint.getY(),
  							point.getX(), point.getY())
  							- w;
  					if (dist < mind) {
  						mind = dist;
  					}
  				}
  				previousPoint = currentPoint;
  			}
  			if (previousPoint != null && !treatFirstPoint) {
  				dist = previousPoint.getDistance(point);
  				if (dist < mind) {
  					mind = dist;
  				}
  			}
  		}
  
  		return mind;
  	}