uses
crt, graph;
const
s=0.001;
xs=30;
ys=-30;
var
j, X0, Y0, x, y, a, b:integer;
i:real;
st:string;
function f1(x:real):real;
begin
f1:=sin(x+Pi/6);
end;
function f2(x:real):real;
begin
f2:=exp(ln(2)*x);
end;
procedure labels;
begin
setcolor(white);
settextstyle(1,0,1);
outtextxy(x0-30,3,'y');
outtextxy(x0+290,y0-35,'x');
line(x0,1,x0,getmaxy);
line(1, y0,getmaxx,y0);
settextstyle(2,0,2);
for j:=-10 to 10 do
begin
setcolor(15);
line(x0+xs*j,y0-7,x0+xs*j,y0+7);
line(x0-7,y0+ys*j,x0+7,y0+ys*j);
setcolor(green);
str(j,st);
outtextxy(x0+xs*j-10,y0+7,st);
if j<>0 then outtextxy(x0+10,y0+ys*j-10,st);
end;
end;
procedure drawgrafik1;
begin
i:=-10;
settextstyle(1,0,4);
repeat
i:=i+s;
x:=round(x0+i*xs);
y:=y0+round(f1(i)*ys);
putpixel(x,y,14);
until i>25;
settextstyle(1,0,1);
setcolor(14);
SetTextJustify(RightText,CenterText);
outtextxy(2*x0,y0+50,'y1=Sin(x+Pi/6)');
end;
procedure drawgrafik2;
var Xmax:Word;
begin
i:=-10;
repeat
i:=i+s;
x:=round(x0+i*xs);
y:=y0+round(f2(i)*ys);
putpixel(x,y,13);
Xmax:=x;
until i>[COLOR=Red][B]3[/B][/COLOR];
settextstyle(1,0,1);
setcolor(13);
SetTextJustify(LeftText,CenterText);
outtextxy(Xmax+20,40,'y2=Exp(x*Ln(2))');
end;
BEGIN
a:=detect;
initgraph(a,b,'');
x0:=GetMaxX div 2;
y0:=GetMaxY div 2;
line(x0,0,x0+8,10);
line(x0,0,x0-8,10);
line(2*x0,y0,2*x0-5,y0+10);
line(2*x0,y0,2*x0-5,y0-10);
labels;
drawgrafik1;
drawgrafik2;
ReadKey;
closegraph;
END.