Pipe
April 2nd, 1999, 04:09 PM
hello,
can someone help me get the case of a steep slope line for the
midpoint line algorithm. 1 < slope < infinity
here is how i computer a postive shallow slope.
0 < slope < 1
i just cant figure out a steep slope.
dx = x1 - x0;
dy = y1 - y0;
d = dy * 2 - dx;
incrE = dy * 2;
incrNE = (dy -dx) * 2;
...
else if( dx > abs(dy) ){ /* Shallows */
if( dy > 0 ){ /* Positive Shallow */
while( x < x1 ){
if( d <= 0 ){
d+=incrE;
x++;
}
else{
d+= incrNE;
x++;
y++;
}
SRGP_pointCoord( x, y );
}
thanks,
pipe
can someone help me get the case of a steep slope line for the
midpoint line algorithm. 1 < slope < infinity
here is how i computer a postive shallow slope.
0 < slope < 1
i just cant figure out a steep slope.
dx = x1 - x0;
dy = y1 - y0;
d = dy * 2 - dx;
incrE = dy * 2;
incrNE = (dy -dx) * 2;
...
else if( dx > abs(dy) ){ /* Shallows */
if( dy > 0 ){ /* Positive Shallow */
while( x < x1 ){
if( d <= 0 ){
d+=incrE;
x++;
}
else{
d+= incrNE;
x++;
y++;
}
SRGP_pointCoord( x, y );
}
thanks,
pipe