# A problem about the midpoint ellipse algorithm

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?

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