1
$\begingroup$

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?

$\endgroup$
1
  • 1
    $\begingroup$ I transcribed your screenshots into text as it's easier to search than images. Welcome to CS.SE! :-) $\endgroup$
    – Juho
    Dec 28 '19 at 8:56
0
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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