Skip to content

Commit

Permalink
added first point to close the circle
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingeek committed Jun 8, 2020
1 parent c07430b commit 1752356
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flyingeek/lidojs",
"version": "1.2.5",
"version": "1.2.6",
"description": "convert Lido OFP text files",
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
Expand Down
1 change: 1 addition & 0 deletions src/modules/geopoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ class GeoPoint {
for (let i = 0; i < steps; i += 1) {
points.push(destination(radius, i * 2 * Math.PI / steps));
}
points.push(points[0]); // close circle
return points;
}

Expand Down
2 changes: 1 addition & 1 deletion test/geopoint.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,5 @@ test("getCenter", () => {

test("circle", () => {
const g = new GeoPoint([0, 90]);
expect(g.circle(420).length).toEqual(64);
expect(g.circle(420).length).toEqual(65);
})

0 comments on commit 1752356

Please sign in to comment.