Determine if two triangles overlap: Difference between revisions

Content added Content deleted
(Added 11l)
Line 2,453: Line 2,453:




=={{header|Mathematica}}==
=={{header|Mathematica}}/{{header|Wolfram Language}}==
<lang Mathematica>
<lang Mathematica>p1 = Polygon@{{0, 0}, {5, 0}, {0, 5}};
p1 = Polygon@{{0, 0}, {5, 0}, {0, 5}};
p2 = Polygon@{{0, 0}, {5, 0}, {0, 6}};
p2 = Polygon@{{0, 0}, {5, 0}, {0, 6}};
! RegionDisjoint[p1, p2]
! RegionDisjoint[p1, p2]
Line 2,481: Line 2,480:
p1 = Polygon@{{0, 0}, {1, 0}, {0, 1}};
p1 = Polygon@{{0, 0}, {1, 0}, {0, 1}};
p2 = Polygon@{{1, 0}, {2, 0}, {1, 1}};
p2 = Polygon@{{1, 0}, {2, 0}, {1, 1}};
! RegionDisjoint[p1, p2]
! RegionDisjoint[p1, p2]</lang>
</lang>
{{out}}
{{out}}
<pre>
<pre>True
True
True
True
False
False
Line 2,491: Line 2,488:
False
False
False
False
True
True</pre>
</pre>


=={{header|Modula-2}}==
=={{header|Modula-2}}==