0

I am trying to implement CGContextAddCurveToPoint() in my app. In addition to the starting point and ending points, the function also takes two control points.

I need to know the exact formula of the curve so I can calculate the shortest distance from the curve to a tapped point, so I'm just wondering if anyone know how, mathematically, the two control points affect the cubic function which it is supposed to draw.

rmaddy
  • 307,833
  • 40
  • 508
  • 550
Flying_Banana
  • 2,806
  • 2
  • 20
  • 36
  • possible duplicate of [Position of a point relative to a Bezier curve](http://stackoverflow.com/questions/920687/position-of-a-point-relative-to-a-bezier-curve) – Cyrille Jul 22 '13 at 11:14

1 Answers1

0

That's a Bézier Curve. You'll find more info about them here and there are plenty of resources on the Net about finding the "distance to a bezier curve", among which this question on SO.

Community
  • 1
  • 1
Cyrille
  • 24,746
  • 12
  • 65
  • 89