code: public void addArc(float left, float top, float right, float bottom, float startAngle,
                         float sweepAngle) {
          PathArcOperation operation = new PathArcOperation(left, top, right, bottom);
          operation.startAngle = startAngle;
          operation.sweepAngle = sweepAngle;
          operations.add(operation);
  
          ArcShadowOperation arcShadowOperation = new ArcShadowOperation(operation);
          float endAngle = startAngle + sweepAngle;
          // Flip the startAngle and endAngle when drawing the shadow inside the bounds. They represent
          // the angles from the center of the circle to the start or end of the arc, respectively. When
          // the shadow is drawn inside the arc, it is going the opposite direction.
          boolean drawShadowInsideBounds = sweepAngle < 0;
          addShadowCompatOperation(
                  arcShadowOperation,
                  drawShadowInsideBounds ? (180 + startAngle) % 360 : startAngle,
                  drawShadowInsideBounds ? (180 + endAngle) % 360 : endAngle);
  
          endX = (left + right) * 0.5f
                  + (right - left) / 2 * (float) Math.cos(Math.toRadians(startAngle + sweepAngle));
          endY = (top + bottom) * 0.5f
                  + (bottom - top) / 2 * (float) Math.sin(Math.toRadians(startAngle + sweepAngle));
      }
docs: Add an arc to the ShapePath.
  
  @param left       the X coordinate of the left side of the rectangle containing the arc
  oval.
  @param top        the Y coordinate of the top of the rectangle containing the arc oval.
  @param right      the X coordinate of the right side of the rectangle containing the arc
  oval.
  @param bottom     the Y coordinate of the bottom of the rectangle containing the arc oval.
  @param startAngle start angle of the arc.
  @param sweepAngle sweep angle of the arc.