var
Form1: TForm1;
l1,s1,t1,m:real;
l,s,t:integer;
Fmas,Qmas:array of array of real;
porf,porq,iq:integer;
uses Thirdmodul, Secondmodul;
function Moment(x:real):real;
var M:real; i,j:byte;
begin
M:=0; i:=0; j:=0;
while i<=11 do begin
if x>Fmas[i,0] then M:=M+(-Fmas[i,1]*(x-Fmas[i,0]));
i:=i+1;
end;
while j<=4 do begin
if x>Qmas[j,0] then begin
if x<Qmas[j,1] then M:=M+(-Qmas[j,2]*((sqr(x-Qmas[j,0]))/2)-((Qmas[j,3]-Qmas[j,2])/(Qmas[j,1]-Qmas[j,0]))*((exp(3*ln(x-Qmas[j,0])))/6))
else M:=M+(-Qmas[j,2]*(Qmas[j,1]-Qmas[j,0])*(x-(Qmas[j,1]+Qmas[j,0])/2)-0.5*(Qmas[j,3]-Qmas[j,2])*(Qmas[j,1]-Qmas[j,0])*(x-(2*Qmas[j,1]+Qmas[j,0])/3));
end;
j:=j+1;
end;
Moment:=M;
end; {function Moment}
function AllMoment(x:real):real;
var M:real; i,j:byte;
begin
M:=0; i:=0; j:=0;
while i<=9 do begin
if x>Fmas[i,0] then M:=M+(-Fmas[i,1]*(x-Fmas[i,0])) else M:=M+(Fmas[i,1]*(Fmas[i,0]-x)); {место ошибки(Fmas[i,0]-динамический массив кот я заполняю в другой форме)}
i:=i+1;
end;
while j<=4 do begin
if x>Qmas[j,0] then begin
if x<Qmas[j,1] then M:=M+(-Qmas[j,2]*((sqr(x-Qmas[j,0]))/2)-((Qmas[j,3]-Qmas[j,2])/(Qmas[j,1]-Qmas[j,0]))*((exp(3*ln(x-Qmas[j,0])))/6)+(Qmas[j,3]-(((Qmas[j,3]-Qmas[j,2])/(Qmas[j,1]-Qmas[j,0]))*(Qmas[j,1]-x)))*(sqr(Qmas[j,1]-x))/2+((Qmas[j,3]-Qmas[j,2])/(Qmas[j,1]-Qmas[j,0]))*((exp(3*ln(Qmas[j,1]-x)))/6))
else M:=M+(-Qmas[j,2]*(Qmas[j,1]-Qmas[j,0])*(x-(Qmas[j,1]+Qmas[j,0])/2)-0.5*(Qmas[j,3]-Qmas[j,2])*(Qmas[j,1]-Qmas[j,0])*(x-(2*Qmas[j,1]+Qmas[j,0])/3));
end
else M:=M+(Qmas[j,2]*(Qmas[j,1]-Qmas[j,0])*((Qmas[j,1]+Qmas[j,0])/2-x)+0.5*(Qmas[j,3]-Qmas[j,2])*(Qmas[j,1]-Qmas[j,0])*((2*Qmas[j,1]+Qmas[j,0])/3-x));
j:=j+1;
end;{while}
AllMoment:=M;
end;
begin
if l1=0 then exit;
with Form1.PaintBox1.Canvas do begin
m:=600/l1;
l:=round(l1*m);
s:=round(s1*m);
t:=round(t1*m);
moveto(30,100);
lineto(l+30,100);
opora1(30+s);
opora2(30+t);
For qi:= 0 to porq do begin
if (Qmas[qi,2]<>0) or (Qmas[qi,3]<>0) then
Drawq(Qmas[qi,0],Qmas[qi,1],Qmas[qi,2]*1e-3,Qmas[qi,3]*1e-3);
end;
For fi:=0 to porf do begin
if (Fmas[fi,1]<>0) then
Drawf(Fmas[fi,0],Fmas[fi,1]*1e-3);
end;
! if (AllMoment(s1)=0) and (AllMoment(t1)=0) then exit;
V1:=AllMoment(t1)/(t1-s1);
V2:=AllMoment(s1)/(t1-s1);
Fmas[porf+1,0]:=s1; Fmas[porf+1,1]:=V1;
Fmas[porf+2,0]:=t1; Fmas[porf+2,1]:=V2;
Momentmax:=0; z1:=0; z:=0;
For mi:= 1 to 101 do begin
if Momentmax < abs(Moment(z1)) then Momentmax:= abs(Moment(z1));
z1:=z1+l1/100;
end; {mi}
scaleM:=round(150/Momentmax); z1:=0; z:=0;
For mi:= 1 to 101 do begin
if Moment(z1)>0 then begin
Moveto(z+30,300); Lineto(z+30,300-round(Moment(z1)*scaleM));
if mi>1 then begin
Moveto(z+30,300-round(Moment(z1)*scaleM)); Lineto(z+30-6,300-round(Moment(z1-l1/100)*scaleM));
end;
end
else begin
Moveto(z+30,300); Lineto(z+100,300+round(Moment(z1)*scaleM));
if mi>1 then begin
Moveto(z+30,300+round(Moment(z1)*scaleM)); Lineto(z+30-6,300+round(Moment(z1-l1/100)*scaleM));
end;
end;
z1:=z1+l1/100; z:=z+6;
end; {mi}
end; {Form1.PaintBox1.Canvas-закончилось}
end; {procedure TForm1.PaintBox1Paint-закончилась}