diff --git a/src/circle.js b/src/circle.js index 85a0af9..2b86270 100644 --- a/src/circle.js +++ b/src/circle.js @@ -34,7 +34,7 @@ function circleRadius(cosRadius, point) { export default function() { var center = constant([0, 0]), radius = constant(90), - precision = constant(6), + precision = constant(2), ring, rotate, stream = {point: point}; diff --git a/test/circle-test.js b/test/circle-test.js index af3bd20..dc52584 100644 --- a/test/circle-test.js +++ b/test/circle-test.js @@ -6,13 +6,13 @@ import {assertInDelta} from "./asserts.js"; it("circle generates a Polygon", () => { const o = geoCircle()(); assert.strictEqual(o.type, "Polygon"); - assertInDelta(o.coordinates, [[[-78.69007,-90],[-90,-84],[-90,-78],[-90,-72],[-90,-66],[-90,-60],[-90,-54],[-90,-48],[-90,-42],[-90,-36],[-90,-30],[-90,-24],[-90,-18],[-90,-12],[-90,-6],[-90,0],[-90,6],[-90,12],[-90,18],[-90,24],[-90,30],[-90,36],[-90,42],[-90,48],[-90,54],[-90,60],[-90,66],[-90,72],[-90,78],[-90,84],[-89.59666,90],[90,84],[90,78],[90,72],[90,66],[90,60],[90,54],[90,48],[90,42],[90,36],[90,30],[90,24],[90,18],[90,12],[90,6],[90,0],[90,-6],[90,-12],[90,-18],[90,-24],[90,-30],[90,-36],[90,-42],[90,-48],[90,-54],[90,-60],[90,-66],[90,-72],[90,-78],[90,-84],[89.56977,-90]]], 1e-5); + assertInDelta(o.coordinates, [[[-78.69007,-90],[-90,-88],[-90,-86],[-90,-84],[-90,-82],[-90,-80],[-90,-78],[-90,-76],[-90,-74],[-90,-72],[-90,-70],[-90,-68],[-90,-66],[-90,-64],[-90,-62],[-90,-60],[-90,-58],[-90,-56],[-90,-54],[-90,-52],[-90,-50],[-90,-48],[-90,-46],[-90,-44],[-90,-42],[-90,-40],[-90,-38],[-90,-36],[-90,-34],[-90,-32],[-90,-30],[-90,-28],[-90,-26],[-90,-24],[-90,-22],[-90,-20],[-90,-18],[-90,-16],[-90,-14],[-90,-12],[-90,-10],[-90,-8],[-90,-6],[-90,-4],[-90,-2],[-90,0],[-90,2],[-90,4],[-90,6],[-90,8],[-90,10],[-90,12],[-90,14],[-90,16],[-90,18],[-90,20],[-90,22],[-90,24],[-90,26],[-90,28],[-90,30],[-90,32],[-90,34],[-90,36],[-90,38],[-90,40],[-90,42],[-90,44],[-90,46],[-90,48],[-90,50],[-90,52],[-90,54],[-90,56],[-90,58],[-90,60],[-90,62],[-90,64],[-90,66],[-90,68],[-90,70],[-90,72],[-90,74],[-90,76],[-90,78],[-90,80],[-90,82],[-90,84],[-90,86],[-90,88],[-89.900735,90],[90,88],[90,86],[90,84],[90,82],[90,80],[90,78],[90,76],[90,74],[90,72],[90,70],[90,68],[90,66],[90,64],[90,62],[90,60],[90,58],[90,56],[90,54],[90,52],[90,50],[90,48],[90,46],[90,44],[90,42],[90,40],[90,38],[90,36],[90,34],[90,32],[90,30],[90,28],[90,26],[90,24],[90,22],[90,20],[90,18],[90,16],[90,14],[90,12],[90,10],[90,8],[90,6],[90,4],[90,2],[90,0],[90,-2],[90,-4],[90,-6],[90,-8],[90,-10],[90,-12],[90,-14],[90,-16],[90,-18],[90,-20],[90,-22],[90,-24],[90,-26],[90,-28],[90,-30],[90,-32],[90,-34],[90,-36],[90,-38],[90,-40],[90,-42],[90,-44],[90,-46],[90,-48],[90,-50],[90,-52],[90,-54],[90,-56],[90,-58],[90,-60],[90,-62],[90,-64],[90,-66],[90,-68],[90,-70],[90,-72],[90,-74],[90,-76],[90,-78],[90,-80],[90,-82],[90,-84],[90,-86],[90,-88],[89.91209,-90]]], 1e-5); }); it("circle.center([0, 90])", () => { const o = geoCircle().center([0, 90])(); assert.strictEqual(o.type, "Polygon"); - assertInDelta(o.coordinates, [range(360, -1, -6).map(function(x) { return [x >= 180 ? x - 360 : x, 0]; })], 1e-6); + assertInDelta(o.coordinates, [range(360, -1, -2).map(function(x) { return [x >= 180 ? x - 360 : x, 0]; })], 1e-6); }); it("circle.center([45, 45])", () => {