mjaschen / phpgeo

Simple Yet Powerful Geo Library for PHP
https://phpgeo.marcusjaschen.de
MIT License
1.55k stars 195 forks source link

Point directions #90

Open nilshoerrmann opened 2 years ago

nilshoerrmann commented 2 years ago

This library provides a class to calculate relative directions between two points (cardinal direction). I don't know about the history of this feature but from a user point of view, it would be handy if this was an integrated method of a point (formerly coordinate):

$point1->isNorthOf($point2); // returns true/false
$point1->directionOf($point2); // returns 'north|south|west|east'