views:

939

answers:

1

Apple's CoreGraphics library defines two functions for describing an arc.

  • CGPathAddArc adds an arc based on a center point, radius, and pair of angles.
  • CGPathAddArcToPoint adds an arc based on a radius and a pair of tangent lines.

The details are explained in the CGPath API reference. Why two functions? Simple convenience? Is one more efficient than the other? Is one defined in terms of the other?

+2  A: 

The former gets you a portion of a circle (really, an approximation of one), while the latter exposes the fact that you're creating a Bézier path. Depending on what you're actually drawing, one or the other might be more convenient. You could really consider both of them conveniences for CGPathAddCurveToPoint.

Chris Hanson
Do you mean to imply that CGPathAddArcToPoint can draw a curve that is not circular? I thought all arcs are portions of a circle.
benzado
A circle cannot be described exactly by a Bezier curve.
Colin Barrett