承接 hotrush/angular-sweep 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

hotrush/angular-sweep

Composer 安装命令:

composer require hotrush/angular-sweep

包简介

README 文档

README

Build Status Scrutinizer Code Quality Packagist

PHP implementation of angular sweep algorithm

Solves issue of finding maximum points that can be enclosed in a circle of given radius and getting the center of this point.

https://en.wikipedia.org/wiki/Visibility_polygon#Angular_sweep

https://www.geeksforgeeks.org/angular-sweep-maximum-points-can-enclosed-circle-given-radius/

https://github.com/pear/Math_Complex/blob/master/Math/Complex.php

Installation

composer require hotrush/angular-sweep

Usage

use Hotrush\AngularSweep\NumbersCollection;
use Hotrush\AngularSweep\ComplexNumber;
use Hotrush\AngularSweep\AngularSweep;

$coordinates = [
    [6.47634, 7.69628],
    [5.16828, 4.79915],
    [6.69533, 6.20378],
];

$collection = new NumbersCollection();

foreach ($coordinates as $coordinate) {
    $collection->add(new ComplexNumber($coordinate[0], $coordinate[1]));
}

$radius = 1;

$sweep = new AngularSweep($collection, $radius);

echo $sweep->getMax();
// 2

$center = $sweep->getMaxCenter();
echo $center->getReal() . '-' . $center->getIm();
// '6.47634-7.69628'

Testing

phpunit
FYI

https://www.geeksforgeeks.org/find-minimum-radius-atleast-k-point-lie-inside-circle/

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固