Example #1
0
  /*
   * (non-Javadoc)
   *
   * @see math.geom2d.Shape2D#transform(math.geom2d.AffineTransform2D)
   */
  public EllipseArc2D transform(AffineTransform2D trans) {
    // transform supporting ellipse
    Ellipse2D ell = ellipse.transform(trans);

    // ensure ellipse is direct
    if (!ell.isDirect()) ell = ell.reverse();

    // Compute position of end points on the transformed ellipse
    double startPos = ell.project(this.firstPoint().transform(trans));
    double endPos = ell.project(this.lastPoint().transform(trans));

    // Compute the new arc
    boolean direct = !(angleExtent > 0 ^ trans.isDirect());
    return new EllipseArc2D(ell, startPos, endPos, direct);
  }