davidvandertuijn / geodistance
Geo Distance
2.0.0
2024-10-02 14:45 UTC
Requires
- php: >=8.0.0
This package is auto-updated.
Last update: 2024-12-02 15:15:00 UTC
README
The Geo Distance calculator is a powerful tool designed to determine the distance between two geographic locations on the Earth’s surface. Whether you are planning a trip, conducting research, or managing logistics, understanding the distance between points is crucial for effective decision-making.
Install
composer require davidvandertuijn/geodistance
Usage
use Davidvandertuijn\Geodistance;
// Rotterdam $lat1 = 51.924419; $lon1 = 4.47917;
// Amsterdam $lat2 = 52.370216; $lon2 = 4.477733;
Miles
Geodistance::distance($lat1, $lon1, $lat2, $lon2, 'M'); // 30.800174981173
Kilometers
Geodistance::distance($lat1, $lon1, $lat2, $lon2, 'K'); // 49.568076804901
Nautical Miles
Geodistance::distance($lat1, $lon1, $lat2, $lon2, 'N'); // 26.746871953651