Published
Edited
Sep 15, 2022
1 fork
Importers
6 stars
Insert cell
Insert cell
Insert cell
Insert cell
viewof S = md`<input type=range value=10 min=1 max=30 step=0.1>`
Insert cell
viewof B = md`<input type=range value=179.99 min=45 max=179.99 step=0.001>`
Insert cell
P = {
//AzimuthalRaw;
LogAzimuthal();
var rotate = this ? this.rotate() : [18.6, -65]; // Iceland
return d3.geoProjection(d3.geoLogAzimuthal).clipAngle(B).rotate(rotate);
}
Insert cell
function LogAzimuthal() {
AzimuthalRaw;
const acos = Math.acos, exp = Math.exp, log = Math.log, sin = Math.sin;

const b = B * Math.PI / 180; // clipAngle in radians (0 < b < PI)
const s = S**2;
const Rb = 1; // this is due to the way d3.fitExtent works, I think
const factor = log(1 + s * b), s_1 = s ? 1 / s : 0;

var p = d3.geoAzimuthalRaw(function(r) {
var z = acos(r);
return z ? log(1 + s * z) / factor / sin(z) : 1;
});

p.invert = d3.geoAzimuthalInvert(function(a) {
if (s == 0) return a;
return (exp(a * factor / Rb) - 1) * s_1;
});

return d3.geoLogAzimuthal = p;
}
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more