Debian Codegraph @

topojson/test/cartesian-ringArea-test.js

raw
1 var tape = require("tape"),
2 cartesian = require("../lib/topojson/cartesian");
3
4 tape("cartesian.ringArea clockwise area is positive", function(test) {
5 test.ok(cartesian.ringArea([[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]) > 0);
6 test.end();
7 });
8
9 tape("cartesian.ringArea counterclockwise area is negative", function(test) {
10 test.ok(cartesian.ringArea([[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]) < 0);
11 test.end();
12 });