Skip to content

Commit

Permalink
use ** operator instead
Browse files Browse the repository at this point in the history
  • Loading branch information
saranrapjs committed Sep 12, 2024
1 parent 0e4a8b2 commit 9a12b71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/frontends/static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ const instancedProject = (origin: Point, displayZoom: number) => {
(projected.x + MAXCOORD) / (MAXCOORD * 2),
1 - (projected.y + MAXCOORD) / (MAXCOORD * 2),
);
return normalized.mult((1 * Math.pow(2, displayZoom)) * 256).sub(origin);
return normalized.mult(2 ** displayZoom * 256).sub(origin);
};
};

const instancedUnproject = (origin: Point, displayZoom: number) => {
return (point: Point) => {
const normalized = new Point(point.x, point.y)
.add(origin)
.div((1 * Math.pow(2, displayZoom)) * 256);
.div(2 ** displayZoom * 256);
const projected = new Point(
normalized.x * (MAXCOORD * 2) - MAXCOORD,
(1 - normalized.y) * (MAXCOORD * 2) - MAXCOORD,
Expand Down

0 comments on commit 9a12b71

Please sign in to comment.