&#x3D; 2 * Math.PI;
        var halfPi &#x3D; Math.PI / 2;
        var sunEl &#x3D; Math.PI * data.sunEl / 180;
        var sunAz &#x3D; Math.PI * data.sunAz / 180;
        var cosSunEl &#x3D; Math.cos(sunEl);
        var sinSunEl &#x3D; Math.sin(sunEl);
        var pixelX, pixelY, x0, x1, y0, y1, offset,
            z0, z1, dzdx, dzdy, slope, aspect, cosIncidence, scaled;
        for (pixelY &#x3D; 0; pixelY &lt;&#x3D; maxY; ++pixelY) {
          y0 &#x3D; pixelY &#x3D;&#x3D;&#x3D; 0 ? 0 : pixelY - 1;
    