Треугольник строится не равносторонний!Подскажите почему? И подскажите как сделать вращение?
Программа:
Program Grafika;
uses Graph,CRT;
var
x,y,x1,y1,x2,y2,x3,y3,a1,b1,a2,b2,a3,b3,c1,d1,c2,d2,c3,d3,r:integer;
procedure GraphRezhim;
var
Driver,Mode,Error:integer;
begin
Driver:=detect;
Initgraph(Driver,Mode,'D:\BGI');
Error:=GraphResult;
if Error<>grOk then writeln('GraphErrorMsg(Error)');
end;
procedure Vershini(var x1,y1,a1,b1,c1,d1:integer;x,y,r:integer);
var
coo:ArcCoordsType;
begin
Arc(x,y,0,90,r);
GetArcCoords(coo);
x1:=coo.Xend;
y1:=coo.Yend;
Arc(x,y,0,210,r);
GetArcCoords(coo);
a1:=coo.Xend;
b1:=coo.Yend;
Arc(x,y,0,330,r);
GetArcCoords(coo);
c1:=coo.Xend;
d1:=coo.Yend;
ClearDevice;
end;
procedure Treugolnik(var x1,y1,x2,y2,x3,y3:integer;x,y:integer);
begin
x:=round((GetMaxX div 10)*cos(2*pi*1/3));
y:=round((GetMaxX div 10)*sin(2*pi*1/3));
x1:=x1+x;
y1:=y1+y;
x:=round((GetMaxX div 10)*cos(2*pi*2/3));
y:=round((GetMaxX div 10)*sin(2*pi*2/3));
x2:=x1+x;
y2:=y1+y;
x:=round((GetMaxX div 10)*cos(2*pi*3/3));
y:=round((GetMaxX div 10)*sin(2*pi*3/3));
x3:=x2+x;
y3:=y2+y;
line(x1,y1,x2,y2);
line(x3,y3,x1,y1);
line(x2,y2,x3,y3);
end;
procedure Dvizhenie(x1,y1,x2,y2,x3,y3,
a1,b1,a2,b2,a3,b3,c1,d1,c2,d2,c3,d3:integer);
begin
while not keypressed do
begin
{Не знаю как сделать}
end;
end;
Begin
GraphRezhim;
Vershini(x1,y1,a1,b1,c1,d1,GetMaxX div 2,GetMaxY div 2,GetMaxY div 4);
Treugolnik(x1,y1,x2,y2,x3,y3,x1,y1);
Treugolnik(a1,b1,a2,b2,a3,b3,a1,b1);
Treugolnik(c1,d1,c2,d2,c3,d3,c1,d1);
readln;
End.