Skip to content

Line::intersectsLine() is buggy #96

@vlad-vinogradov

Description

@vlad-vinogradov

Hello,
Unfortunately, the Line::intersectsLine() method doesn't always work correctly. Try this test:

<?php
declare(strict_types=1);
require 'vendor/autoload.php';

use Location\Coordinate;
use Location\Line;

$line1 = new Line(
    new Coordinate(0.0, 0.0),
    new Coordinate(0.0, 2.0)
);
$line2 = new Line(
    new Coordinate(2.0, 2.0),
    new Coordinate(0.0, 10.0)
);
if ($line1->intersectsLine($line2)) {
    echo 'Line::intersectsLine() is buggy!'.PHP_EOL;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions