There are multiple ways to project a point onto a Bézier curve. If you do the math analytically, you are often left with some high order polynomial that you must solve with a root finding algorithm. An easier way is to use a minimisation algorithm to find the smallest distance between a point and the curve.
Read MoreFinding the position and angle of points along a Bézier curve on iOS.
Bézier curves are extremely useful in computer graphics and are hence supported by the iOS Foundation Framework via the UIBezierPath class. Unfortunately, this class is designed for drawing, so it lacks an inbuilt method that allows you to easily interpolate the path, making it very difficult to find the positions and tangents of points along the path.
Read MoreObjective-C implementation of the Golden Section Search using blocks.
Blocks are a powerful feature of Objective-C and are easy to use once you get your head around them. They are very useful in scenarios where you want to pass a function as a parameter to another function like a Golden Section Search.
Read MoreCreating smooth frame-by-frame animations on iOS by calculating the live time interval between frames.
Creating smooth frame-by-frame custom animations on iOS is easier than you think...
Read More