I use the following code to draw an arc in the lower half of a circle.
According to documentation in Apple:
This method creates an open subpath. The created arc lies on the perimeter of the specified circle. When drawn in the default coordinate system, the start and end angles are based on the unit circle shown in Figure 1. For example, specifying a start angle of 0 radians, an end angle of π radians, and setting the clockwise parameter to YES draws the bottom half of the circle. However, specifying the same start and end angles but setting the clockwise parameter set to NO draws the top half of the circle.
I wrote
std::complex<double> start1( std::polar(190.0,0.0) );
CGPoint targetStart1 = CGPointMake(start1.real() + 342.0, start1.imag() + 220.);
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, targetStart1.x, targetStart1.y);
CGPathAddArc(path, NULL, 342.0, 220.0, 190, 0.0, PI_180, YES );
CGContextAddPath(context, path);
CGContextSetLineWidth( context, 15.0 );
// set the color for the stroked circle
CGContextSetStrokeColorWithColor( context, [UIColor greenColor].CGColor);
CGContextStrokePath(context);
CGPathRelease(path);
However, the arc is drawn in the top half of the circle (see the green ring). I am wondering if I have accidentally somewhere in the code flipped the coordination system, but I don't know for what command I should search.
Thanks for ur help.