point_black
Все, что живет в нашем воображении, может стать реальностью.
const
nn=100;
k=pi/180;

var

y,x:array[1..3] of integer;
xp,yp:array[1..3] of real;
time,dx, dy,R,n:integer;
m,px,py:real;
kM,T:real;
xmax,ymax:integer;
x0,y0, i,xc,yc,A,p:integer;
toc:array[1..3] of Tpoint;



procedure RIS1;

Begin

toc[1]:=point(x[1],y[1]);
toc[2]:=point(x[2],y[2]);
toc[3]:=point(x[3],y[3]);
{xc:=x[1]+round(A/2);
yc:=y[1]-Round(sin(pi/3)*A*1/3); }

With Form2.Canvas do
begin
pen.color:=clBlack;
Brush.Color:=clred;

Brush.Style:=Bssolid;
polygon(toc);

moveTo(x[1],y[1]);
lineTo(xc,yc);
moveTo(x[2],y[2]);
lineTo(xc,yc);
moveTo(x[3],y[3]);
lineTo(xc,yc);
end;
End;

procedure RIS2;

Begin

With Form2.Canvas do
begin
pen.color:=clbtnface;
Brush.Color:=clbtnface;

Brush.Style:=Bssolid;
polygon(toc);

moveTo(x[1],y[1]);
lineTo(xc,yc);
moveTo(x[2],y[2]);
lineTo(xc,yc);
moveTo(x[3],y[3]);
lineTo(xc,yc);
end;
End;

procedure poborot;
begin
for i:=1 to 3 do
begin
p:=x[i];
px:=(xc+(x[i]-xc)*cos(t*k)+(y[i]-yc)*sin(t*k));
py:=(yc-(x[i]-xc)*sin(t*k)+(y[i]-yc)*cos(t*k));
x[i]:=round(px);
y[i]:=round(py);
end;

end;

procedure mash;
begin
a:=round(a*m);
for i:=1 to 3 do
begin
x[i]:=round(m*x[i]+xc*(1-m));
y[i]:=round(m*y[i]+yc*(1-m));
end;
end;

procedure pere;
begin
for i:=1 to 3 do
x[i]:=x[i]+dx;
xc:=xc+dx;

end;
procedure TForm2.Button1Click(Sender: TObject); //perenos
begin
pere;
ris2;
ris1;
end;

procedure TForm2.Button2Click(Sender: TObject);
begin
ris2;
poborot;

ris1 ;
end;

procedure TForm2.Button3Click(Sender: TObject);
begin
ris2;
Mash;
ris1;
end;

procedure TForm2.Button4Click(Sender: TObject);
begin
Timer1.Enabled:=true;
end;

procedure TForm2.Button5Click(Sender: TObject);
begin
close;
end;

procedure TForm2.Button6Click(Sender: TObject);
begin
ris1;
end;

procedure TForm2.FormCreate(Sender: TObject);
Begin
Timer1.Enabled:=false;
A:=50;
x0:=300;
y0:=200;
dx:=5;
t:=3;
m:=1.02;
x[1]:=x0;
x[2]:=x0+a;
x[3]:=round(x0+a/2);

y[1]:=y0;
y[2]:=y0;
y[3]:=y0-round(sin(pi/3)*A);


toc[1]:=point(x[1],y[1]);
toc[2]:=point(x[2],y[2]);
toc[3]:=point(x[3],y[3]);
xc:=x[1]+round(A/2);
yc:=y[1]-Round(sin(pi/3)*A*1/3);



end;

procedure TForm2.Timer1Timer(Sender: TObject);
begin
ris2;
mash;
poborot;
pere;
ris1;
end;

end.