/* Puts into (x, y) the coordinate to which a line should be drawn given the step. This should be used in a loop to flatten a curve, like this:  */
static void quad_bezier_flatten_at(const quad_bezier_t *q, const quad_bezier_flatten_params_t *params, int step, vg_lite_float_t *x, vg_lite_float_t *y)
/* Puts into (x, y) the coordinate to which a line should be drawn given the step. This should be used in a loop to flatten a curve, like this:  */
static void quad_bezier_flatten_at(const quad_bezier_t *q, const quad_bezier_flatten_params_t *params, int step, vg_lite_float_t *x, vg_lite_float_t *y)
{
    const vg_lite_float_t a0 = params->a0, a2 = params->a2, u0 = params->u0, u2 = params->u2;
    const int num_points = params->num_points;
    const vg_lite_float_t u = approx_inverse_integral(a0 + ((a2 - a0) * step) / num_points);
    const vg_lite_float_t t = (u - u0) / (u2 - u0);
    quad_bezier_eval(q, t, x, y);
}