midpoint algorithm for parabola



I have for the past few days been trying to work on the derivation of a
Bresenham algorithm on a parabola. yet it just seems that everything I
come up yields me a straight line.

int x = 0, y = 0, d = 0;
for(x=0,y=0; x<100; x++) {
setPixel(x,y);
d+=2*x+1;
if(d>=0) {
y++;
d--;
}
}

This code always yields a straight line, and I cannot figure out why. I
have even look at other derivations of a parabola. I was wondering what
I could be doing wrong? Anyone have any suggestions or insights. I
would write more, but the derivation can be found at multiple
locations, but if someone has some working code that I could view that
would be even better.

.



Relevant Pages

  • Re: what "REALLY" is derivative?
    ... > Back in grade 11 when learning about parabolas, ... > I thought this was nonsense, because if two curves (parabola and line) ... There's a lot wrong with that derivation, ... you did was divide delta-y by delta-x. ...
    (sci.math)
  • Re: Minimize and maximize
    ... Tonico wrote: ... I made an error in derivation. ... The function fis a parabola (and thus its extreme point is its ... I'll restrict the problem such that: ...
    (sci.math)

Loading