ajarunthomas/haversine

使用哈夫维森公式计算两个地理坐标之间的距离

v1.0.0 2021-01-18 08:44 UTC

This package is auto-updated.

Last update: 2024-09-21 21:06:48 UTC


README

A Simple Facade for Laravel that calculates the Distance between 2 geo locations defined by latitude and longitude details using the Haversine Formula.

说明

使用Composer安装

composer require ajarunthomas/haversine

包含门面

use Ajarunthomas\Facades\Haversine;

可选地,在app.php配置文件的别名部分包含门面

'Haversine' => Ajarunthomas\Facades\Haversine::class,

计算两个坐标之间的距离

$distance = Haversine::distance([24.885368,55.120223],[25.223954,55.274097]);