C++ - Improving drawing a function using piecewise Bezier Curves.

preview_player
Показать описание
In order to know if we can draw a certain piece of a parameterized function (x(s), y(s)) on the interval s in [0, 1] with a Bezier curve - we get five points Q(s), including their direction vector d/ds Q(s) - from an external source (say, some lambda). The points at s=0 and s=1 are used as begin and end point of a bezier, fitting Q'(0) and Q'(1) as well, while passing through Q(0.5). If this is possible and the sum of the square of the distance from Q(0.25) and Q(0.75) to the Bezier curve is less than a pixel then we draw this Bezier curve, otherwise the curve is cut in two and we recursively repeat the test.
Рекомендации по теме