I'm developing an app that lets the user draw with his finger 3 points then the app should connect those three to produce an arc. 1st point and 3rd point are the ends of the arc and the 2nd point is the control/center point.
I finished the 3 dots part but I'm struggling with drawing an arc accurately. When I used CGContextAddQuadCurveToPoint the produced arc is on the 1st and 3rd points (ends of the arc) but it does not go through the 2nd point. These are my arguments,
Am I using the right method or should I go for something like CGContextAddArcToPoint, CGContextAddArc or bezier paths? Can someone please explain for me the general idea of how I can connect 3 points?
Thanks in advance!
I finished the 3 dots part but I'm struggling with drawing an arc accurately. When I used CGContextAddQuadCurveToPoint the produced arc is on the 1st and 3rd points (ends of the arc) but it does not go through the 2nd point. These are my arguments,
Code:
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), first.x, first.y);
CGContextAddQuadCurveToPoint(UIGraphicsGetCurrentContext(), second.x, second.y, third.x, third.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
Am I using the right method or should I go for something like CGContextAddArcToPoint, CGContextAddArc or bezier paths? Can someone please explain for me the general idea of how I can connect 3 points?
Thanks in advance!