//Обернене до r1
for i:=1 to 5 do
for j:=1 to 5 do
if i<>j then
begin
if form1.strngrd_obr1.Cells[i-1,j-1]='1' then
begin
if i=1 then begin p1x:=67; p1y:=8; end;
if i=2 then begin p1x:=125; p1y:=49; end;
if i=3 then begin p1x:=104; p1y:=117; end;
if i=4 then begin p1x:=30; p1y:=117; end;
if i=5 then begin p1x:=10; p1y:=49; end;
if j=1 then begin p2x:=67; p2y:=8; end;
if j=2 then begin p2x:=125; p2y:=49; end;
if j=3 then begin p2x:=104; p2y:=117; end;
if j=4 then begin p2x:=30; p2y:=117; end;
if j=5 then begin p2x:=10; p2y:=49; end;
DrawArrow(Form1.Img_obr1.Canvas,p1x,p1y,p2x,p2y,2);
end;
end
else
if form1.strngrd_obr1.cells[i-1,j-1]='1' then
begin
if i=1 then begin p1x:=67; p1y:=4; end;
if i=2 then begin p1x:=129; p1y:=49; end;
if i=3 then begin p1x:=104; p1y:=121; end;
if i=4 then begin p1x:=30; p1y:=121; end;
if i=5 then begin p1x:=6; p1y:=49; end;
form1.Img_obr1.Canvas.Ellipse(p1x+4,p1y+4,p1x-4,p1y-4);
end;
//Обернене до r2
for i:=1 to 5 do
for j:=1 to 5 do
if i<>j then
begin
if form1.strngrd_obr2.Cells[i-1,j-1]='1' then
begin
if i=1 then begin p1x:=67; p1y:=8; end;
if i=2 then begin p1x:=125; p1y:=49; end;
if i=3 then begin p1x:=104; p1y:=117; end;
if i=4 then begin p1x:=30; p1y:=117; end;
if i=5 then begin p1x:=10; p1y:=49; end;
if j=1 then begin p2x:=67; p2y:=8; end;
if j=2 then begin p2x:=125; p2y:=49; end;
if j=3 then begin p2x:=104; p2y:=117; end;
if j=4 then begin p2x:=30; p2y:=117; end;
if j=5 then begin p2x:=10; p2y:=49; end;
DrawArrow(Form1.Img_obr2.Canvas,p1x,p1y,p2x,p2y,2);
end;
end
else
if form1.strngrd_obr2.cells[i-1,j-1]='1' then
begin
if i=1 then begin p1x:=67; p1y:=4; end;
if i=2 then begin p1x:=129; p1y:=49; end;
if i=3 then begin p1x:=104; p1y:=121; end;
if i=4 then begin p1x:=30; p1y:=121; end;
if i=5 then begin p1x:=6; p1y:=49; end;
form1.Img_obr2.Canvas.Ellipse(p1x+4,p1y+4,p1x-4,p1y-4);
end;
//Двоїсте до R1
for i:=1 to 5 do
for j:=1 to 5 do
if i<>j then
begin
if form1.strngrd_dvr1.Cells[i-1,j-1]='1' then
begin
if i=1 then begin p1x:=67; p1y:=8; end;
if i=2 then begin p1x:=125; p1y:=49; end;
if i=3 then begin p1x:=104; p1y:=117; end;
if i=4 then begin p1x:=30; p1y:=117; end;
if i=5 then begin p1x:=10; p1y:=49; end;
if j=1 then begin p2x:=67; p2y:=8; end;
if j=2 then begin p2x:=125; p2y:=49; end;
if j=3 then begin p2x:=104; p2y:=117; end;
if j=4 then begin p2x:=30; p2y:=117; end;
if j=5 then begin p2x:=10; p2y:=49; end;
DrawArrow(Form1.Img_dvr1.Canvas,p1x,p1y,p2x,p2y,2);
end;
end
else
if form1.strngrd_dvr1.cells[i-1,j-1]='1' then
begin
if i=1 then begin p1x:=67; p1y:=4; end;
if i=2 then begin p1x:=129; p1y:=49; end;
if i=3 then begin p1x:=104; p1y:=121; end;
if i=4 then begin p1x:=30; p1y:=121; end;
if i=5 then begin p1x:=6; p1y:=49; end;
form1.Img_dvr1.Canvas.Ellipse(p1x+4,p1y+4,p1x-4,p1y-4);
end;
//Двоїсте до R2
for i:=1 to 5 do
for j:=1 to 5 do
if i<>j then
begin
if form1.strngrd_dvr2.Cells[i-1,j-1]='1' then
begin
if i=1 then begin p1x:=67; p1y:=8; end;
if i=2 then begin p1x:=125; p1y:=49; end;
if i=3 then begin p1x:=104; p1y:=117; end;
if i=4 then begin p1x:=30; p1y:=117; end;
if i=5 then begin p1x:=10; p1y:=49; end;
if j=1 then begin p2x:=67; p2y:=8; end;
if j=2 then begin p2x:=125; p2y:=49; end;
if j=3 then begin p2x:=104; p2y:=117; end;
if j=4 then begin p2x:=30; p2y:=117; end;
if j=5 then begin p2x:=10; p2y:=49; end;
DrawArrow(Form1.Img_dvr2.Canvas,p1x,p1y,p2x,p2y,2);
end;
end
else
if form1.strngrd_dvr2.cells[i-1,j-1]='1' then
begin
if i=1 then begin p1x:=67; p1y:=4; end;
if i=2 then begin p1x:=129; p1y:=49; end;
if i=3 then begin p1x:=104; p1y:=121; end;
if i=4 then begin p1x:=30; p1y:=121; end;
if i=5 then begin p1x:=6; p1y:=49; end;
form1.Img_dvr2.Canvas.Ellipse(p1x+4,p1y+4,p1x-4,p1y-4);
end;
