public void arcTo(float cX,float cY,float endX,float endY,boolean clockwise){
  if (pointSize < 2) {
    throw new RuntimeException("Cannot add arc to path if it doesn't already have a starting point.");
  }
  float startX=points[pointSize - 2];
  float startY=points[pointSize - 1];
  float dx=endX - cX;
  float dy=endY - cY;
  double r2=Math.sqrt(dx * dx + dy * dy);
  double dx1=startX - cX;
  double dy1=startY - cY;
  double r1=Math.sqrt(dx1 * dx1 + dy1 * dy1);
  if (Math.abs(r1 - r2) > 1) {
    Log.e(new RuntimeException("arcTo() called with start and end points that don't lie on the same arc r1=" + r1 + ", r2="+ r2));
  }
  Ellipse e=new Ellipse();
  Ellipse.initWithBounds(e,cX - r2,cY - r2,r2 * 2,r2 * 2);
  double startAngle=e.getAngleAtPoint(startX,startY);
  double endAngle=e.getAngleAtPoint(endX,endY);
  double sweepAngle=endAngle - startAngle;
  if (clockwise && sweepAngle > 0) {
    sweepAngle=-sweepAngle;
  }
 else   if (!clockwise && sweepAngle > 0) {
    sweepAngle=2 * Math.PI - sweepAngle;
  }
  arc(cX - r2,cY - r2,r2 * 2,r2 * 2,-startAngle,sweepAngle,true);
  lineTo(endX,endY);
}

public void arcTo ( float cX , float cY , float endX , float endY , boolean clockwise ) { if ( pointSize < 2 ) { throw new RuntimeException ( "Cannot add arc to path if it doesn't already have a starting point." ) ; } float startX = points [ pointSize - 2 ] ; float startY = points [ pointSize - 1 ] ; float dx = endX - cX ; float dy = endY - cY ; double r2 = Math . sqrt ( dx * dx + dy * dy ) ; double dx1 = startX - cX ; double dy1 = startY - cY ; double r1 = Math . sqrt ( dx1 * dx1 + dy1 * dy1 ) ; if ( Math . abs ( r1 - r2 ) > 1 ) { Log . e ( new RuntimeException ( "arcTo() called with start and end points that don't lie on the same arc r1=" + r1 + ", r2=" + r2 ) ) ; } Ellipse e = new Ellipse ( ) ; Ellipse . initWithBounds ( e , cX - r2 , cY - r2 , r2 * 2 , r2 * 2 ) ; double startAngle = e . getAngleAtPoint ( startX , startY ) ; double endAngle = e . getAngleAtPoint ( endX , endY ) ; double sweepAngle = endAngle - startAngle ; if ( clockwise && sweepAngle > 0 ) { sweepAngle = - sweepAngle ; } else if ( ! clockwise && sweepAngle > 0 ) { sweepAngle = 2 * Math . PI - sweepAngle ; } arc ( cX - r2 , cY - r2 , r2 * 2 , r2 * 2 , - startAngle , sweepAngle , true ) ; lineTo ( endX , endY ) ; }
adds an arc to the path . this method uses an approximation of an arc using a cubic path . it is not a precise arc .
