uses graph; var ks,ko:integer; {kr-kozeppont} procedure grafinic; var gd,gm:integer; path:string; begin gd:=detect; gm:=0; path:='c:\langs\tp\bgi'; InitGraph(gd,gm,path); ClearDevice; end; procedure beallit; begin ks:=GetMaxY div 2; ko:=GetMaxX div 2; {ko:=0;} end; procedure rajzol(x,y:real); var sszam,oszam:integer; s,o:integer; begin sszam:=GetMaxY; oszam:=GetMaxX; s:=round(ks-y); o:=round(ko+x); if ((s>=0) and (s<=sszam) and (o<=oszam)) then putpixel(o,s,white); end; procedure sinus_alap; var sv1,sv2:real; x,y:integer; begin for x:=0 to 314 do begin sv1:=x/100; sv2:=sin(sv1); sv2:=5*sv2; y:=round(sv2); rajzol(x,y); end; end; procedure sinus; var x,y:real; lkoz,rlk:real; talalt:boolean; i:real; hanyadiknulla:integer; rx,ry:real; begin x:=0; y:=0; hanyadiknulla:=1; lkoz:=0.01; rlk:=1/lkoz; rajzol(x,y); while x<=3.1415926 do begin { while (hanyadiknulla<=2) do begin} if ( (y+lkoz) <= sin(x) ) then begin y:=y+lkoz; end else if ( (y+lkoz) <= sin(x+lkoz) ) then begin x:=x+lkoz; y:=y+lkoz; end else if ( y<=sin(x+lkoz) ) then begin x:=x+lkoz; end else if ( y-lkoz<=sin(x+lkoz) ) then begin y:=y-lkoz; x:=x+lkoz; end else if ( y-lkoz<=sin(x) ) then begin y:=y-lkoz; end; rx:=x*rlk; ry:=y*rlk; rajzol(rx,-ry); rajzol(-rx,ry); if y=0 then inc(hanyadiknulla); end; end; begin grafinic; beallit; sinus; readln; closegraph; end.