You can use the following code to draw an arc using Quartz:
CGContextMoveToPoint(context2, x, y);
CGContextAddArcToPoint(context2, x1, y1, x2, y2, r);
In these functions, (x,y)
is the starting point and r
is the arc radius but what are (x1,y1)
and (x2,y2)
?
AddArcToPoint works like this:
where P1
is the point the path is currently at, r
is the radius
given to the function, and the red line is the line that addArcToPoint will add to the current path. It won't continue to the second point at x2, y2
; it will stop at the end of the arc.
I have a blog post about this here.