home *** CD-ROM | disk | FTP | other *** search
- { Copyright (C) 1989 Adam Fritz, 133 Main St., Afton, N.Y. 13730 }
-
- procedure StrokeCircle ( xc, yc : integer ; r : word ) ;
-
- { CircRAM - draw circle using rotation angle method }
- { and `minimum' angle step }
-
- var
- ixar,iyar : word ; { aspect ratio parameters }
- iar : longint ; { aspect ratio B16 }
- ida : integer ; { loop control }
- ix,iy,it : longint ; { coordinate variables B22 }
- ix0,iy0,ix1,iy1 : integer ; { display coordinates B0 }
-
- begin
- { constraint test }
- if r < 510 then begin
- { aspect ratio }
- GetAspectRatio(ixar,iyar) ;
- iar := SwapLong(longint(ixar)) div longint(iyar) ;
- { prescale and offset }
- ix := SwapLong(r shl 6 + idr) ;
- iy := 0 ;
- { starting position }
- ix0 := RoundScaleB6(LongHi(ix)) ;
- iy0 := 0 ;
- MoveTo(xc+ix0,yc) ;
- { circle }
- for ida := 1 to 49 do begin
- { rotate coordinates }
- it := (-ix div 16 - iy) div 8 + ix ;
- iy := (-iy div 16 + ix) div 8 + iy ;
- ix := it ;
- { apply aspect and scale B0 }
- ix1 := RoundScaleB6(LongHi(ix)) ;
- iy1 := RoundScaleB6(LongHi(LongHi(iy) * iar)) ;
- LineTo(xc+ix1,yc+iy1)
-
- end ;
- { closure }
- LineTo(xc+ix0,yc+iy0)
-
- end
- end ;
-
- { Copyright (C) 1989 Adam Fritz, 133 Main St., Afton, N.Y. 13730 }