10 REM > BLib.Graphic.Circle 1.01 22May1986
   20 REM v1.00 15Apr1985 Code from Econet front end
   30 REM v1.01 22May1986 Optimised MOVE/PLOTs
   40 :
   50 :
   60 REM PROCcircle - draw a circle
   70 REM --------------------------
   80 REM x%,y%=centre, r%=radius, f%=filled
   90 :
  100 DEFPROCcircle(x%,y%,r%,f%)
  110 LOCAL step,s,c,xp,yp,xr,s%,k%
  120 k%=13+72*(f%AND1)      :REM PLOT action
  130 step=-2*PI/32          :REM Length of each arc
  140 s=SINstep              :REM Precalculate sin of step
  150 c=COSstep              :REM Precalculate cosine of step
  160 xp=r%:yp=0             :REM Set initial position
  170 MOVE x%+r%,y%          :REM Move to initial point on edge
  180 FOR s%=1 TO 31         :REM We'll do 31 segments here
  190   xr=xp*c-yp*s           :REM Calculate next point on edge
  200   yp=xp*s+yp*c
  210   xp=xr
  220   IF f%:MOVE x%,y%       :REM If filled, extra point at centre
  230   PLOT k%,x%+xp,y%+yp    :REM Draw a line or a segment
  240 NEXT                   :REM And again
  250 IF f%:MOVE x%,y%       :REM Do final segment back to start
  260 PLOT k%,x%+r%,y%
  270 ENDPROC