We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32e1855 commit 8e559e2Copy full SHA for 8e559e2
src/utils/projection.ts
@@ -98,12 +98,14 @@ export class ProjectionGrid {
98
}
99
100
findPointInterpolated(lat: number, lon: number) {
101
- let [x, y] = this.projection.forward(lat, lon);
+ let [ypos, xpos] = this.projection.forward(lat, lon);
102
+ let x = (xpos - this.origin[0]) / this.dx;
103
+ let y = (ypos - this.origin[1]) / this.dy;
104
+ let xFraction = x - Math.floor(x);
105
+ let yFraction = y - Math.floor(y);
106
if (y < 0 || x < 0 || y >= this.ny || x >= this.nx) {
107
return null;
108
- let xFraction = x / 1 - Math.floor(x / 1);
- let yFraction = y / 1 - Math.floor(y / 1);
109
return { index: Math.floor(y) * this.nx + Math.floor(x), xFraction, yFraction };
110
111
0 commit comments