home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug099.arc
/
ARC.I
< prev
next >
Wrap
Text File
|
1979-12-31
|
896b
|
35 lines
Procedure Arc(XCentre,YCentre,XRadius,YRadius,Start,Finish : Integer;
F : Operation);
Procedure PlotArc(XCentre,YCentre,XRadius,YRadius,Start,Finish : Integer;
F : Operation);
const
Radians = 57.295779;
var
X, Y, XStore, YStore : Integer;
Loop : Real;
Begin
Loop := Start / Radians;
While Loop <= Finish / Radians do
begin
X := Round(XRadius * Cos(Loop)) + XCentre;
Y := Round(YRadius * Sin(Loop)) + YCentre;
if Loop = Start / Radians then begin XStore := X; YStore := Y; end;
Plot(XStore,YStore,X,Y,F);
XStore := X; YStore := Y;
Loop := Loop + 0.15707962;
end;
End;
Begin
if Start > Finish then
begin
PlotArc(XCentre,YCentre,XRadius,YRadius,Start,360,F);
Start := 0;
end;
PlotArc(XCentre,YCentre,XRadius,YRadius,Start,Finish,F);
End;