summaryrefslogtreecommitdiff
path: root/test/interpolate-test.js
blob: 9b040ea0e7672bf0e1e5f4a30e8720f1e717ec82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var tape = require("tape"),
    d3 = require("../");

require("./inDelta");

tape("geoInterpolate(a, a) returns a", function(test) {
  test.deepEqual(d3.geoInterpolate([140.63289, -29.95101], [140.63289, -29.95101])(0.5), [140.63289, -29.95101]);
  test.end();
});

tape("geoInterpolate(a, b) returns the expected values when a and b lie on the equator", function(test) {
  test.inDelta(d3.geoInterpolate([10, 0], [20, 0])(0.5), [15, 0], 1e-6);
  test.end();
});

tape("geoInterpolate(a, b) returns the expected values when a and b lie on a meridian", function(test) {
  test.inDelta(d3.geoInterpolate([10, -20], [10, 40])(0.5), [10, 10], 1e-6);
  test.end();
});