home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / m / miscpas.zip / CIRCLE.LIB < prev    next >
Text File  |  1986-02-05  |  1KB  |  32 lines

  1. {@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
  2.  
  3.      Of course, CIRCLE works only in a graphics mode!
  4.  
  5.      The procedure CIRCLE has six parameters:
  6.          H and K:  the XY coordinates of the circle's center
  7.          R      :  itsRadius
  8.          Res    :  the Resolution.  This is proportional to
  9.                    the actual number of pixels used to draw the
  10.                    circle
  11.          Aspect :  Adjust this value until the circles are ROUND on
  12.                    your particular screen and for the particular
  13.                    graphics mode you are using.
  14.          Color  :  set to 0, 1, 2, or 3
  15.  
  16.  
  17. }
  18. {@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
  19.  
  20. procedure circle(H,K,R,Res : integer; Aspect : real; Color : byte);
  21. var
  22.   X, Y, Theta : integer;
  23. begin
  24.   for Theta := 1 to trunc(pi*2*Res) do
  25.     begin
  26.       X := H + trunc( R * sin(Theta/Res));
  27.       Y := K + trunc(Aspect * ( R * cos(Theta/Res)));
  28.       plot(X,Y,Color);
  29.     end;
  30. end;
  31. {@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
  32.