geoOrtelius = ({ width = 960, height = 500, rotate = [0, 0] } = {}) => {
const pi_2 = Math.PI / 2;
const pi2_4 = pi_2 ** 2;
return d3
.geoProjection((x, y) => {
const s = Math.sign(x);
x = Math.abs(x);
const f = Math.max(1e-12, Math.min(x, pi_2));
const F = (f + pi2_4 / f) / 2;
return [s * (x + F * (Math.sqrt(1 - (y / F) ** 2) - 1)), y];
})
.precision(0.1)
.scale(width / 2 / Math.PI)
.translate([width / 2, height / 2])
.rotate(rotate);
}