maris / geo-haversine-calculator
Калькулятор Хаверсайна.
1.0.0
2023-08-19 11:29 UTC
Requires
- php: >=8.1
- maris/geo-interfaces: *
Requires (Dev)
This package is auto-updated.
Last update: 2024-10-19 14:12:52 UTC
README
Калькулятор Хаверсайна для расчета расстояний.
$ellipsoid = new class () implements \Maris\Interfaces\Geo\Model\EllipsoidInterface { //// Реализовать эллипсоид. public function getArithmeticMeanRadius() : float { return 6371008.8; } }; $calculator = new \Maris\Geo\Haversine\HaversineCalculator( $ellipsoid ); $point1 = new class implements \Maris\Interfaces\Geo\Aggregate\LocationAggregateInterface{}; $point2 = new class implements \Maris\Interfaces\Geo\Aggregate\LocationAggregateInterface{}; $distance = $calculator->calculateDistance( $point1, $point2 ); var_dump($distance); // float растояние между точками.