I am trying to render the outline of a rotated ellipse on raster graphics.
The general form of a conic is:
H(x, y) = A x² + B xy + C y² + D x + E y + F = 0
I am currently able to render the ellipse by inputting incremental x values (starting from left most) and then solving a the resultant quadratic equation in y.
I came across this post while trying to optimise my code and found this:
Lastly, note that incremental computation saves work when evaluating H, on the line of
H(x+1, y) = H(x, y) + A.(2x+1) + B.y + D = H(x, y) + (2A).x + (A + B.y + D)
It seems like a way better idea to use this incremental computation method than calculating the roots every time I want to draw a point.
I would like to understand how I can use this method, given I have the starting (x,y) point and the ending (xmax,ymax) point (right-most point of ellipse).
Calling
$$ F(x,y) = a x^2+b x y + c y^2+ d x + e y + f = 0 $$
given $x = x^*$ we can calculate the corresponding $y^*$ using an iterative process like Newton's
$$ y_{k+1} = y_k - \frac{F(x^*,y_k)}{F_y(x^*,y_k)} $$
Here
$$ F_y(x,y) = b x + 2c y + e $$
NOTE
The $y_0$ initial guess should be given near the potential solution.
Attached the MATHEMATICA script which produces the previous graphics.