I want to build a CGPathRef
programatically based on the coordinates of the Sun at different points of the day. Calculating the points is not a problem, but I want to make a CGPathRef
that is smooth and thought CGPathAddCurveToPoint
would be appropriate.
I understand the path, transform, x and y parameters, but I'm not sure about the others. Per the Apple documentation they are the control points, and I'm guessing they are like you'd see in a vector drawing program where you can adjust the way the curve passes through the point.
My question is how to choose points that relate to my coordinates without knowing what those coordinates are ahead of time? I'm thinking maybe just subtract a set amount from each of the first control points and add the same amount to the second control points, but that sounds over simplified to me. Is there a standard method for generating control points that "make sense" for a smooth curve?
void CGPathAddCurveToPoint (
CGMutablePathRef path,
const CGAffineTransform *m,
CGFloat cp1x,
CGFloat cp1y,
CGFloat cp2x,
CGFloat cp2y,
CGFloat x,
CGFloat y
);