You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownew \InvalidArgumentException('The distance must be greater than zero!');
}
A distance of 0 is valid in my humble opinion.
One (untested) example:
$centralIpswich = newLatLong(51.73441738801072, 0.4632282257080078); // Central Ipswich co-ordinates!$centralAylesbury = newLatLong(51.73441738801072, 0.4632282257080078); // Central Ipswich co-ordinates!// Create a new instance of the class passing in two coordinates (LatLong objects)$pointToPointCalculator = newCalculator($centralIpswich, $centralAylesbury);
// Calculate the distance and return in both kilometre and miles...$km = $pointToPointCalculator->get()->asKilometres();
The text was updated successfully, but these errors were encountered:
Hello and thanks for the library.
I get an error when I try to calculate the distance between 2 points that have same coordinates.
I think it should check with
!$distance >= 0
instead of!$distance > 0
here:distical/src/Entities/Distance.php
Lines 57 to 59 in 892f9a1
A distance of
0
is valid in my humble opinion.One (untested) example:
The text was updated successfully, but these errors were encountered: