divineomega/php-distance 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

divineomega/php-distance

最新稳定版本:v1.0.1

Composer 安装命令:

composer require divineomega/php-distance

包简介

Allows for calculation of many types of distance between points

README 文档

README

Build Status Coverage Status Packagist

The PHP Distance library allows for calculation of many types of distance between points.

Installation

PHP Distance can be easily installed using Composer. Just run the following command from the root of your project.

composer require divineomega/php-distance

If you have never used the Composer dependency manager before, head to the Composer website for more information on how to get started.

Usage

See the following code snippet that demonstates how to use this library.

$a = new Point($x1, $y1);
$b = new Point($x2, $y2);
$c = new Point($x3, $y3, $z3); # Infinite dimensions supported by some distance types

$distanceType = new Euclidean();
$distanceType = new EuclideanSquare();
$distanceType = new Haversine();	# For GPS coordinates (latitude and longitude)

$distance = (new Distance())
		->type(new Euclidean())	# Type is optional, and defaults to Euclidean distance
		->from($a)
		->to($b)
		->get();

统计信息

  • 总下载量: 10.9k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-only
  • 更新时间: 2018-11-25