summaryrefslogtreecommitdiff
path: root/src/projection/gnomonic.js
blob: 5da1cc79479278397cfefea89c019722edaec52d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import {atan, cos, sin} from "../math.js";
import {azimuthalInvert} from "./azimuthal.js";
import projection from "./index.js";

export function gnomonicRaw(x, y) {
  var cy = cos(y), k = cos(x) * cy;
  return [cy * sin(x) / k, sin(y) / k];
}

gnomonicRaw.invert = azimuthalInvert(atan);

export default function() {
  return projection(gnomonicRaw)
      .scale(144.049)
      .clipAngle(60);
}