Program parabola;
Uses crt,GraphABC;
Const
w=800;
h=600;
x0=400;
y0=300;
k=20;
var i,x1,y1:integer;
x,y:real;
begin SetWindowSIze(w,h);
Line(0,y0,w,y0);
Line(x0,0,x0,h);
TextOut(x0+5,y0+5, '0');
TextOut(w-10,y0+5, 'x');
TextOut(x0+5,10,'y');
i:=k;
while i<w do
begin
Line (i,y0-5,i,y0+5);
i:=i+k;
end;
While i<h do
begin Line(x0-5,i,x0+5,i);
x:=-20;
while x<=20 do
y:=x*sin(x);
x1:=Round(x0+k*x);
y1:=Round(y0-k*y);
SetPixel(x0,y1,clblue);
SetPixel(x1,y0,clblue);
SetPixel(x1,y1,clred);
x:=x+0.01;
SaveWindow('Grafic.bmp');
end.
Program parabola;
Uses crt,GraphABC;
Const
w=800;
h=600;
x0=400;
y0=300;
k=20;
var i,x1,y1:integer;
x,y:real;
begin SetWindowSIze(w,h);
Line(0,y0,w,y0);
Line(x0,0,x0,h);
TextOut(x0+5,y0+5, '0');
TextOut(w-10,y0+5, 'x');
TextOut(x0+5,10,'y');
i:=k;
while i<w do
begin
Line (i,y0-5,i,y0+5);
i:=i+k;
end;
i:=k;
While i<h do
begin Line(x0-5,i,x0+5,i);
i:=i+k;
end;
x:=-20;
while x<=20 do
begin
y:=x*sin(x);
x1:=Round(x0+k*x);
y1:=Round(y0-k*y);
SetPixel(x0,y1,clblue);
SetPixel(x1,y0,clblue);
SetPixel(x1,y1,clred);
x:=x+0.01;
end;
SaveWindow('Grafic.bmp');
end.