I have read the book "Computer Graphics with Open GL" (Hearn, Fourth Edition) recently. However, when I read the midpoint ellipse algorithm, the following example in the book is confusing me:

For region 2, the initial point is $(x_0,y_0) = (7,3)$ and the initial decision parameter is $$p2_0 = f_{\text{ellipse}}\Big(7 + \frac{1}{2}, 2 \Big) = -151$$

in which $f_{\text{ellipse}}(x,y) = r^2_y x^2 + r^2_x y^2 - r^2_x r^2_y$.

When I fed the value into the formula mentioned above, eventually, I get -23. Therefore, is the result given in this example wrong?

  • 1
    $\begingroup$ I transcribed your screenshots into text as it's easier to search than images. Welcome to CS.SE! :-) $\endgroup$
    – Juho
    Dec 28, 2019 at 8:56
  • $\begingroup$ You forgot to supply the values of $r_x,r_y$. $\endgroup$ Feb 7 at 8:45

1 Answer 1


I've got a test tomorrow and just happened to come across this question today. I think the answer given might be incorrect and -23 is the correct value the equation returns. Just to cross-check, are the consecutive decision parameter values 361 and 297? Irrespective, the values are such that the coordinates generated would be identical.

  • $\begingroup$ This is not an answer, move it to a comment. $\endgroup$ Jun 8 at 12:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.