/** @deprecated use copy constructor instead (0.11.2) */
 @Deprecated
 @Override
 public PointArray2D clone() {
   PointArray2D set = new PointArray2D(this.size());
   for (Point2D point : this) set.add(point);
   return set;
 }
  /*
   * (non-Javadoc)
   *
   * @see math.geom2d.Shape2D#transform(math.geom2d.AffineTransform2D)
   */
  public PointArray2D transform(AffineTransform2D trans) {
    PointArray2D res = new PointArray2D(points.size());

    for (Point2D point : points) res.add(point.transform(trans));

    return res;
  }
  public PointArray2D transform(CircleInversion2D inv) {

    PointArray2D array = new PointArray2D(points.size());

    for (Point2D point : points) array.add(point.transform(inv));

    return array;
  }
  /*
   * (non-Javadoc)
   *
   * @see math.geom2d.Shape2D#clip(java.awt.geom.Rectangle2D)
   */
  public PointArray2D clip(Box2D box) {
    // allocate memory for result
    PointArray2D res = new PointArray2D(points.size());

    // select only points inside of box
    for (Point2D point : points) {
      if (box.contains(point)) {
        res.add(point);
      }
    }

    // use array the right size
    res.points.trimToSize();

    // return result
    return res;
  }