//Відношення r1
for i:=1 to 5 do
for j:=1 to 5 do
if i<>j then
begin
if form1.strngrd1.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_r1.Canvas,p1x,p1y,p2x,p2y,2);
end;
end
else
if form1.strngrd1.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_r1.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.strngrd2.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_r2.Canvas,p1x,p1y,p2x,p2y,2);
end;
end
else
if form1.strngrd2.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_r2.Canvas.Ellipse(p1x+4,p1y+4,p1x-4,p1y-4);
end;
//Перетин
for i:=1 to 5 do
for j:=1 to 5 do
if i<>j then
begin
if form1.strngrd_per.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_per.Canvas,p1x,p1y,p2x,p2y,2);
end;
end
else
if form1.strngrd_per.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_per.Canvas.Ellipse(p1x+4,p1y+4,p1x-4,p1y-4);
end;
//Об’єднання
for i:=1 to 5 do
for j:=1 to 5 do
if i<>j then
begin
if form1.strngrd_dop.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_ob.Canvas,p1x,p1y,p2x,p2y,2);
end;
end
else
if form1.strngrd_dop.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_ob.Canvas.Ellipse(p1x+4,p1y+4,p1x-4,p1y-4);
end;
