Skip to content
/ neudev Public

"A Rectangle-Intersection Algorithm with Limited Resource Requirements. Authors: Devai, F, Neumann L

Notifications You must be signed in to change notification settings

sttawm/neudev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

npm install

Test

npm test

Overview

Algorithms for reporting intersections between bounding boxes.

Use like:

var alg = intersectionAlgorithm(),
    S = [bbox_1, bbox_2, ... bbox_n],
    reportPair = function (i, j) {
    // do something with i and j, the indices of the intersecting bounding boxes
    // note that duplicates may be reported
    };

// Report the intersecting bounding boxes
alg(S, reportPair);

Naive

The naive algorithm, with run-time O(n^2).

var naive = naive();

Tiled

A tile-based algorithm, that first breaks the space into tiles, before running the naive algorithm on each tile.

// Subdivide the x-space twice, into 4 partitions of equal width
// Subdivide the y-space four times, into 16 partitions of equal height.
var tiled = tiled().xdepth(2).ydepth(4);

Devai-Neumann

A theoretically optimal algorithm

var neudev = neudev();

About

"A Rectangle-Intersection Algorithm with Limited Resource Requirements. Authors: Devai, F, Neumann L

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published