gnomonic.js 387 B

12345678910111213141516
  1. import {atan, cos, sin} from "../math";
  2. import {azimuthalInvert} from "./azimuthal";
  3. import projection from "./index";
  4. export function gnomonicRaw(x, y) {
  5. var cy = cos(y), k = cos(x) * cy;
  6. return [cy * sin(x) / k, sin(y) / k];
  7. }
  8. gnomonicRaw.invert = azimuthalInvert(atan);
  9. export default function() {
  10. return projection(gnomonicRaw)
  11. .scale(144.049)
  12. .clipAngle(60);
  13. }