|In the schema ABC is the convex hull of the quadratic curve. We
find F a point on the quadratic curve, by splitting AB in 2, this
give us D. We do the same for BC which give us E. And we cut DE in 2
which give us F. Because the curve is recursively made, ABC could
also be any part of the curve at any time. To determine the flatness
of the curve, we just need to calculate The length of GF. G is the
middle of AC.
D = (A+B)/2
E = (B+C)/2
F = (D+E)/2 = (A+C)/4 + B/2
G = (A+C)/2
length(GF) = length (F-G) = length (B/2 - (A+C)/2)
length(GF) = sqrt( sqr(B.x-(A.x+C.x)/2) + sqr(B.y-(A.y+C.y)/2) )
So we should subdivide if the distance of GF is more than one pixel.
The test can be done on the square of the distance sqr(length(GF)) > sqr(1)