3 ms·
Every time I remember how simply Bézier curves can be implemented it makes me happy, so I thought I'd share this. Given a list of n points it generates an n-de
by kilovoltaire 15y ago
Every time I remember how simply Bézier curves can be implemented it makes me happy, so I thought I'd share this.
Given a list of n points it generates an n-degree Bézier curve. The complexity of this is O(2^n) so even a 20-point curve could be quite slow.
(In "real" graphics code this is avoided by using, e.g. a second-degree curve, regardless of the number of points. But the implementation of that doesn't have as pretty a recursive structure imho.)