I have UIBezierPath in the application. When the finger touch on the path is recognized i want to subdivide that curve and store that two curves into two different objects. So touch co-ordinates will work as end-point for one curve and start-point for second curve.
Again if i touch on any of this curve, that curve will subdivide into two other curves and so on.
I searched for this a lot. But could not find any good solution.
Also I do not have idea if there is any other way to do this. Any help would be greatly appreciated.
Thanks
You can do this with the de Casteljau algorithm. If you’re really into the maths of it check out the Wikipedia page here, but if you’re not that into the maths it will probably confuse you more than anything when it’s actually quite simple…
Now you have two new Bezier curves, the first using control points A1, B1, C1, D1 and the second using A2, B2, C2, D2.