Published
Edited
Jan 6, 2022
5 forks
Importers
94 stars
Also listed in…
Maps
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function getDerivatives(top, left, bottom, right) {
const dzdx = right - left;
const dzdy = top - bottom;

return {
dzdx,
dzdy
};
}
Insert cell
Insert cell
Insert cell
getSlope = (dzdx, dzdy, z = 0.2) =>
Math.atan(z * Math.sqrt(dzdx ** 2 + dzdy ** 2)) // the z factor controls how exaggerated the peaks look
Insert cell
Insert cell
Insert cell
Insert cell
getAspect = (dzdx, dzdy) => {
return Math.atan2(-dzdy, -dzdx);
}
Insert cell
Insert cell
Insert cell
function getReflectance(aspect, slope, sunAzimuth, sunElevation) {
return (
Math.cos(Math.PI * 0.5 - aspect - sunAzimuth) *
Math.sin(slope) *
Math.sin(Math.PI * 0.5 - sunElevation) +
Math.cos(slope) * Math.cos(Math.PI * 0.5 - sunElevation)
);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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