Apex › Storage & databases

How curves are drawn (Bézier & de Casteljau)

A smooth curve from a few control points, built with nothing but repeated linear interpolation. de Casteljau’s algorithm lerps along the control polygon, then along those points, down to one point on the curve; sweep the parameter and it traces the whole Bézier. It equals the Bernstein polynomial exactly (verified to 3e-16), stays inside the control points’ convex hull, and splits into two sub-Béziers that reproduce it (verified to 1e-16). The workhorse of fonts, SVG/PDF paths, and UI easing. Drag the control points and watch the pyramid.

More in Storage & databases