/
var
/
www
/
qr4y.gr
/
server
/
delivery
/
node_modules
/
point-in-polygon
/
test
/
/var/www/qr4y.gr/server/delivery/node_modules/point-in-polygon/test
mkdir
upload
Name
Size
Mode
Actions
box-offset.js
892
0644
edit
dl
rm
box.js
881
0644
edit
dl
rm
flat-offset.js
993
0644
edit
dl
rm
flat.js
729
0644
edit
dl
rm
Edit:
/var/www/qr4y.gr/server/delivery/node_modules/point-in-polygon/test/box-offset.js
(892B)
var test = require('tape'); var inside = require('../'); test('nested box with offsets', function (t) { var polygon = [ [100,101],[102,103], [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ], [200,201] ]; t.ok(inside([ 1.5, 1.5 ], polygon, 2, 6)); t.ok(inside([ 1.2, 1.9 ], polygon, 2, 6)); t.ok(!inside([ 0, 1.9 ], polygon, 2, 6)); t.ok(!inside([ 1.5, 2 ], polygon, 2, 6)); t.ok(!inside([ 1.5, 2.2 ], polygon, 2, 6)); t.ok(!inside([ 3, 5 ], polygon, 2, 6)); t.end(); }); test('nested flag with offsets', function (t) { var polygon = [ [100,101], [ 1, 1 ], [ 10, 1 ], [ 5, 5 ], [ 10, 10 ], [ 1, 10 ] ]; t.ok(inside([ 2, 5 ], polygon, 1)); t.ok(inside([ 3, 5 ], polygon, 1)); t.ok(inside([ 4, 5 ], polygon, 1)); t.ok(!inside([ 10, 5 ], polygon, 1)); t.ok(!inside([ 11, 5 ], polygon, 1)); t.ok(!inside([ 9, 5 ], polygon, 1)); t.end(); });
Save
cmd:
run