Catalog npm
PACKAGE EXPLORERView in registry

2d-polygon-contains-polygon

npm

test if a polygon completely contains another polygon

2dcontainmentpolygon
Versions collected1
Direct dependencies4From release 1.0.0
Last observed20 Oct, 19:10 UTC

README

Current package documentation

2d-plolygon-contains-polygon

test if a polygon completely contains another polygon

this can useful when computing whether or not a polygon is a hole or island.

This library is not highly optimized, but should suit your needs for the general case. Hit me up if it's not fast enough and I'll see what we can do.

install

npm install 2d-plolygon-contains-polygon

use


var a = [
  [0, 0],
  [100, 0],
  [100, 100],
  [0, 100]
];

var b = [
  [20, 20],
  [80, 20],
  [80, 80],
  [20, 80]
];

console.log(contains(a, b));
// output: true

api surface

contains(container, contained)

container and container are polygons represented by a 2d array (i.e. [[x, y], [x, y], ])

returns true if contained is contained in container, and false otherwise.

license

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.0Registry latest24 Apr 20154

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
tmpvar/2d-polygon-contains-polygon

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:10 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:ecd2bab8212df7ddb18132e93e78ae395a5b5707f5e4927ee5f1f4fbd282eb1b