Mail Archives: djgpp/1997/08/04/04:02:41
That´s my circle proc. Circles are almost faster than lines...
Procedure Circle(x0,y0,r:Integer);
Var
x,y,b,h: Integer;
Begin
x:=r; y:=r; b:=0; h:=0;
Plot(x0+x,y0); Plot(x0-x,y0);
Plot(x0,y0+x); Plot(x0,y0-x);
while x>h do Begin
inc(h); y:=y-h;
if y<=0 then Begin inc(b); x:=r-b; y:=y+x; end;
Plot(x0+x,y0+h); Plot(x0-x,y0+h);
Plot(x0+h,y0+x); Plot(x0+h,y0-x);
Plot(x0-x,y0-h); Plot(x0+x,y0-h);
Plot(x0-h,y0-x); Plot(x0-h,y0+x);
end;
End;
--
_ x ___
/ \_/_\_ /,--' p DOT steiner AT t-online DOT de (Peter Steiner)
\/>'~~~~//
\_____/ signature V0.2 alpha
- Raw text -