←предыдущая следующая→
1 2 3 4 5 6 7 8 9
работы с графиком');
outtextxy(160,155,' используйте клавиши:');
outtextxy(160,180,' PAGE UP-первоначальный');
outtextxy(160,195,' вид графика;');
outtextxy(160,210,' HOME-начальный масштаб;');
outtextxy(160,225,' INSERT-включить/выключеть');
outtextxy(160,240,' заливку области;');
outtextxy(160,255,' DELETE-включить/выключеть');
outtextxy(160,270,' сетку;');
outtextxy(160,285,' END-показать/убрать цифры');
outtextxy(160,300,' F1- Помощь;');
outtextxy(160,315,' Стрелки ВВЕРХ/ВНИЗ- ');
outtextxy(160,330,' увеличение/уменьшение');
outtextxy(160,345,' масштаб .');
outtextxy(160,360,'Для возрата нажмите ENTER.');
end
else
begin
outtextxy(160,115,' HELP WINDOW');
outtextxy(160,140,' For the work with graphic');
outtextxy(160,155,' use this keys:');
outtextxy(160,180,' PAGE UP-Primery form of');
outtextxy(160,195,' graphik;');
outtextxy(160,210,' HOME-Primery scale;');
outtextxy(160,225,' INSERT-Turn on/off inking');
outtextxy(160,240,' the field;');
outtextxy(160,255,' DELETE-Turn on/off the');
outtextxy(160,270,' net;');
outtextxy(160,285,' END-View/delete the figures');
outtextxy(160,300,' F1- Help;');
outtextxy(160,315,' Arrows UP/DOWN-Increase/ ');
outtextxy(160,330,' lower the scale;');
outtextxy(160,360,'Press ENTER to continue.');
end;
readln;
setcolor(15);
end;
procedure graphik(ea:word;a,b:real;f1:string);
{процедура построения графиков}
var
f,f2:string;
d:char;
i,v,r:integer;
x1,x2,n,p,x:integer;
c,k,k1:longint;
y:array[0..1] of double;
begin
x1:=-240;
x2:=240;
c:=24;
setcolor(15);
n:=0;v:=0;r:=0;
repeat
cleardevice;
settextstyle(0,0,0);
if ea mod 2 =0 then
begin
outtextxy(10,1,'Нажмите F1 для помощи');
str(c/24:2:2,f);
f:='Масштаб '+f+':1';
end
else
begin
outtextxy(10,1,'Press F1 for help');
str(c/24:2:2,f);
f:='Scale '+f+':1';
end;
outtextxy(200,1,f);
settextstyle(3,0,1);
outtextxy(307,10,'y');
outtextxy(574,235,'x');
outtextxy(310,240,'0');
setlinestyle(1,7,100);
line(70,240,580,240);
line(320,20,320,460);
line(320,20,315,25);
line(321,20,326,25);
line(580,239,575,244);
line(580,240,575,235);
line(70,239,580,239);
line(321,20,321,460);
for i:=-9 to 10 do
begin
if ((320+i*24)71) then
line(320+i*24,240,320+i*24,242);
if ((240+i*24)19) then
line(320,240+i*24,322,240+i*24);
end;
setcolor(15);
for x:= -240+round((240+x1)/10) to 240+round((240+x1)/10) do
begin
funktia(1,x-1,x,y,c,f1);
k:=round(240-(y[0])*c);
k1:=round(240-(y[1])*c);
if ((k0)or(k10)) then
line(319-round((240+x1)/10)+x,k,320-round((240+x1)/10)+x,k1);
end;
if (v mod 2)=0 then
begin
funktia(1,a,b,y,1,f1);
k:=round(240-(y[0])*c);
k1:=round(240-(y[1])*c);
line(320-round((240+x1)/10)+round(a*c),k,320-round((240+x1)/10)+round(a*c),240);
line(320-round((240+x1)/10)+round(b*c),k1,320-round((240+x1)/10)+round(b*c),240);
if 320-round((240+x1)/10)+a*c560 then
begin
funktia(1,(-240-round((240+x1)/10))/c,(240-round((240+x1)/10))/c,y,1,f1);
k1:=round(240-(y[1])*c);
line(560,k1,560,240);
end;
for x:= -240 to 240 do
begin
funktia(1,x-1,x,y,c,f1);
k1:=round(240-(y[1])*c);
if ((x/c)>a) and ((x/c)2) then
begin
if k17 then
setfillstyle(6,3)
else
setfillstyle(1,3);
floodfill(320-round((240+x1)/10)+x,k1,15);
end;
end;
end;
end;
str(x1,f2);
outtextxy(1,450,f2);
if (n mod 2)=0 then
for i:=-9 to 10 do
begin
settextstyle(2,0,2);
setcolor(14);
if ((320+i*24)71)and(i0) then
begin
str((i*24+round((240+x1)/10))/c:2:2,f);
p:=247;
outtextxy(310+i*24,p,f);
str(-i*24/c:2:2,f);
outtextxy(330,240+i*24,f);
end;
end;
for i:=-9 to 10 do
begin
setcolor(15);
if ((r mod 2)=1) and (i0) then
begin
if ((320+i*24)71) then
line(320+i*24,20,320+i*24,460);
if ((240+i*24)19) then
line(80,240+i*24,560,240+i*24);
end;
end;
setcolor(15);
d:=readkey;
case d of
#75:
begin
x1:=x1-30;
x2:=x2-30;
end;
#77:
begin
x1:=x1+30;
x2:=x2+30;
end;
#80:
if c>1 then
c:=c-1;
#72:
c:=c+1;
#71:
c:=24;
#79:
n:=n+1;
#83:
r:=r+1;
#82:
v:=v+1;
#73:
begin
c:=24;
n:=0;r:=0;v:=0;x1:=-240;x2:=240;
end;
#59:
hwg(ea);
end;
until d=#13;
end;
end.
================================================
==========МОДУЛЬ UNIT==========
================================================
{$N+}
Unit k_unit;
{Модуль нахождения интеграл от многочлена q(q-1)..(q-i+1)(q-i-1)..(q-n),}
{где n-точность интеграла ,i-номер коофициента. }
interface
procedure rasposn(f:string;x:real;var ec:word;var t:real);
procedure hkoef(n:integer;var h:array of double);
procedure funktia(n:integer;a,b:real;var y:array of double;c:real;f:string);
procedure koef(w:array of double;n:integer;var e:array of double);
procedure mnogochlen(n,i:integer;var c:array of double);
function facktorial(n:integer):double;
function integral(w:array of double;n:integer):double;
function mainint(n:integer;a,b:real;y:array of double):double;
implementation
procedure rasposn(f:string;x:real;var ec:word;var t:real);
{Процедура распознования функции}
var
k:word;
begin
k:=pos('x',f);
if k0 then
begin {Распознавание функции}
ec:=1; {Код ошибки}
t:=x;
k:=pos('abs(x)',f);
if k0 then t:=abs(x);
k:=pos('sin(x)',f);
if k0 then t:=sin(x);
k:=pos('cos(x)',f);
if k0 then t:=cos(x);
k:=pos('arctg(x)',f);
if k0 then t:=arctan(x);
k:=pos('sqr(x)',f);
if k0 then t:=x*x;
k:=pos('exp(x)',f);
if k0 then t:=exp(x);
k:=pos('cos(x)*x',f);
if k0 then t:=cos(x)*x;
k:=pos('ln(x)',f);
←предыдущая следующая→
1 2 3 4 5 6 7 8 9
|
|