tuupola/trilateration 问题修复 & 功能扩展

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

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

tuupola/trilateration

Composer 安装命令:

composer require tuupola/trilateration

包简介

Trilateration for PHP

README 文档

README

Latest Version Software License Build Status Coverage

PHP implementation of Trilateration algorithm. See Wifi Trilateration With Three or More Points for walkthrough.

Install

Install the library using Composer.

$ composer require tuupola/trilateration

Usage

Pure PHP Version

Pure PHP implementation calculates the position by finding the intersection of three spheres using traditional algebra. If the spheres do not intersect algorithm enlarges the spheres until they do intersect.

use Tuupola\Trilateration\Intersection;
use Tuupola\Trilateration\Sphere;

$sphere1 = new Sphere(60.1695, 24.9354, 81175);
$sphere2 = new Sphere(58.3806, 26.7251, 162311);
$sphere3 = new Sphere(58.3859, 24.4971, 116932);

$trilateration = new Intersection($sphere1, $sphere2, $sphere3);
$point = $trilateration->position();

print_r($point);

/*
Tuupola\Trilateration\Point Object
(
    [latitude:protected] => 59.418775152143
    [longitude:protected] => 24.753287172291
)
*/

$url = "https://appelsiini.net/circles/"
     . "?c={$sphere1}&c={$sphere2}&c={$sphere3}&m={$point}";

print '<a href="{$url}">Open in map</a>';

Open in map

Non Linear Least Squares Using R

R version uses non linear least squares fitting. It can use three or more locations for the calculation and gives better results when given data is less accurate. Before using this version you must install the R language and geosphere package.

$ sudo yum -y install R
$ sudo su - -c "R -e \"install.packages('geosphere', repos='http://cran.rstudio.com/')\""
use Tuupola\Trilateration\NonLinearLeastSquares;
use Tuupola\Trilateration\Sphere;

$sphere1 = new Sphere(60.1695, 24.9354, 81175);
$sphere2 = new Sphere(58.3806, 26.7251, 162311);
$sphere3 = new Sphere(58.3859, 24.4971, 116932);

$trilateration = new NonLinearLeastSquares($sphere1, $sphere2, $sphere3);
$point = $trilateration->position();

print_r($point);

/*
Tuupola\Trilateration\Point Object
(
    [latitude:protected] => 59.4355408765689
    [longitude:protected] => 24.7747644991839

)
*/

$url = "https://appelsiini.net/circles/"
     . "?c={$sphere1}&c={$sphere2}&c={$sphere3}&m={$point}";

print '<a href="{$url}">Open in map</a>';

Open in map

Testing

You can run tests either manually or automatically on every code change. Automatic tests require entr to work.

$ make test
$ brew install entr
$ make watch

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email tuupola@appelsiini.net instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 24
  • Watchers: 4
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固