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

export function orthographicRaw(x, y) {
  return [cos(y) * sin(x), sin(y)];
}

orthographicRaw.invert = azimuthalInvert(asin);

export default function() {
  return projection(orthographicRaw)
      .scale(249.5)
      .clipAngle(90 + epsilon);
}