program OnePolygon; {$I typedef.bic} {these files must be} {$I graphix.bic} {included in this order} {$I kernel.bic} {$I symbol.bic} {$I axis.hgh} {$I polygon.hgh} {$I findwrld.hgh} var header:wrkstring; procedure PolygonDem; var n:integer; b,a:PlotArray; ch:char; x1,x2:integer; procedure GenerateFunction(var a:PlotArray); var i:integer; {generate a sine polygon} delta:real; begin n:=30;header:='Sinuskurve'; delta:=2*pi/(n-1); for i:=1 to n do begin a[i,1]:=(i-1)*delta-pi; a[i,2]:=sin(a[i,1]); end; end; begin GenerateFunction(a); {generate the polygon} DefineWindow(1,0,0,XMaxGlb,YMaxGlb); DefineWorld(1,-pi,1,pi,-1); SelectWorld(1); SelectWindow(1); DrawBorder; DrawAxis(8,8,0,0,0,0,1,1,true); {draw the axes} DrawPolygon(a,1,n,0,0,-1); {draw the polygon} end; begin InitGraphic; {initialize the graphics system} PolygonDem; {do the demo} readln; LeaveGraphic; end.