tuupola/trilateration
Composer 安装命令:
composer require tuupola/trilateration
包简介
Trilateration for PHP
README 文档
README
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>';
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>';
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.
tuupola/trilateration 适用场景与选型建议
tuupola/trilateration 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 632 次下载、GitHub Stars 达 24, 最近一次更新时间为 2017 年 05 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wifi」 「trilateration」 「geoposition」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tuupola/trilateration 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tuupola/trilateration 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tuupola/trilateration 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A clean, modern, and easy-to-use QR code generator for Laravel
Library to determine absolute or relative locations of points by measurement of distances.
A sub-module for Access Manager
A sub-module for Access Manager
A sub-module for Access Manager
A sub-module for Access Manager
统计信息
- 总下载量: 632
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 24
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-05-15