承接 josue/spatial-hash-table 相关项目开发

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

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

josue/spatial-hash-table

Composer 安装命令:

composer require josue/spatial-hash-table

包简介

2D hash table for fast edges-touching-circle retrieval

README 文档

README

Using Composer, just add it to your composer.json by running:

composer require josue/spatial-hash-table

Description

You can throw edges and points at it and than make fast proximity queries in a fixed radius (set in the constructor).

Usage

Example

Alt Test case graph

<?php

use SpatialHashTable\BiHashTable;
use SpatialHashTable\SupportedGeometries\Edge;
use SpatialHashTable\SupportedGeometries\Point;

$b = new BiHashTable(1);

$b->addElement(new Edge(new Point(-1.5, -1), new Point( -0.5, -0.5), 100));
$b->addElement(new Edge(new Point(1.25, 1.5), new Point( 0.5, 0.75), 200));
$b->addElement(new Edge(new Point(1.75, 1.75), new Point( 1.75, 1.25), 300));
$b->addElement(new Point(0.5, 0.5, 400));


echo json_encode($b->getAllElementsInCircle(new Point(0,0)));

And the output is:

{
  "100": {
    "id": 100,
    "p1": {
      "id": 0,
      "x": -1.5,
      "y": -1
    },
    "p2": {
      "id": 0,
      "x": -0.5,
      "y": -0.5
    }
  },
  "200": {
    "id": 200,
    "p1": {
      "id": 0,
      "x": 1.25,
      "y": 1.5
    },
    "p2": {
      "id": 0,
      "x": 0.5,
      "y": 0.75
    }
  },
  "400": {
    "id": 400,
    "x": 0.5,
    "y": 0.5
  }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固