davidvandertuijn / geodistance
Geo Distance
Installs: 82
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/davidvandertuijn/geodistance
Requires
- php: >=8.0.0
This package is auto-updated.
Last update: 2025-09-30 16:52:43 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