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
  • 314,917
  • 42
  • 532
  • 579
Flying_Banana
  • 2,864
  • 2
  • 22
  • 38
  • 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
  • 25,014
  • 12
  • 67
  • 90