Program Grafik;
uses GraphABC;
Var i,x0,y0,x1,y1,k: integer;
x,y: real;
Begin
setWindowSize(640,400);
x0:=320; y0:=200; k:=30;
line(x0,20,x0,380); line(20,y0,620,y0);
line(x0,20,x0-10,30); line(x0,20,x0+10,30);
line(630,y0,620,y0-10); line(630,y0,620,y0+10);
for i:=-10 to 10 do
begin
line(x0+(i*k),y0-10,x0+(i*k),y0+10);
textout(x0+(i*k),y0+10,inttostr(i));
end;
for i:=-5 to 5 do
begin
line(x0-10,y0+(i*k),x0+10,y0+(i*k));
if i<>0 then textout(x0+10,y0+(i*k),inttostr(-i));
end;
setPenColor(clRed);
x:=-10;
While x<=10 do
begin
y:=1/(sqr(x)+1);;
x1:=trunc(x0+x*k); y1:=trunc(y0-y*k);
circle(x1,y1,2);
x:=x+0.01;
end;
End.
2
Program Grafik;
uses GraphABC;
Var i,x0,y0,x1,y1,k: integer;
x,y: real;
Begin
setWindowSize(640,400);
x0:=320; y0:=200; k:=30;
line(x0,20,x0,380); line(20,y0,620,y0);
line(x0,20,x0-10,30); line(x0,20,x0+10,30);
line(630,y0,620,y0-10); line(630,y0,620,y0+10);
for i:=-10 to 10 do
begin
line(x0+(i*k),y0-10,x0+(i*k),y0+10);
textout(x0+(i*k),y0+10,inttostr(i));
end;
for i:=-5 to 5 do
begin
line(x0-10,y0+(i*k),x0+10,y0+(i*k));
if i<>0 then textout(x0+10,y0+(i*k),inttostr(-i));
end;
setPenColor(clRed);
x:=-10;
While x<=10 do
begin
y:=cos(sqr(X));;
x1:=trunc(x0+x*k); y1:=trunc(y0-y*k);
circle(x1,y1,2);
x:=x+0.01;
end;
End.