Mathematical formula for Bezier curves
For each segment of the path between two control points, it approximates a cubic Bezier curve:



where P0 and P3 are the control points and P1 and P2 are the handles.