Ejemplo n.º 1
0
function doLinesIntersect($line1, $line2)
{
    $rect1 = new Rectangle();
    $rect1->lineBbox($line1);
    $rect2 = new Rectangle();
    $rect2->lineBbox($line2);
    return $rect1->intersectsRect($rect2) && $line1->lineSegmentTouchesOrCrossesLine($line2) && $line2->lineSegmentTouchesOrCrossesLine($line1);
}