Skip to content

Commit

Permalink
add test case for issue #107
Browse files Browse the repository at this point in the history
  • Loading branch information
mjaschen committed Jul 1, 2024
1 parent 727109c commit 2df3dc5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/Regression/Github/107/Issue107Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace Location;

use Location\Distance\Vincenty;
use Location\Exception\NotConvergingException;
use Location\Utility\PointToLineDistance;
use PHPUnit\Framework\TestCase;

class Issue107Test extends TestCase
{
/**
* Nearly antipodal points can cause the Vincenty formula to not converge.
*
* @see http://www.movable-type.co.uk/scripts/latlong-vincenty.html
* @see https://archive.ph/jrxcA
*/
public function testForIssue107(): void
{
$this->expectException(NotConvergingException::class);

$coordinate1 = new Coordinate(-5.59248, -78.774002);
$coordinate2 = new Coordinate(5.79, 101.15);

$coordinate1->getDistance($coordinate2, new Vincenty());
}
}

0 comments on commit 2df3dc5

Please sign in to comment.