Published
Edited
May 14, 2020
Fork of Hillshader
1 star
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=.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 * .5 - aspect - sunAzimuth) * Math.sin(slope) * Math.sin(Math.PI * .5 - sunElevation) +
Math.cos(slope) * Math.cos(Math.PI * .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