Plan 9 from Bell Labs’s /usr/web/sources/contrib/rsc/pico/doug.pico
lerp = x < X/3 ? 0 : x > 2*X/3 ? 255 : (x-X/3)*Z/(X/3) r doug rdoug = Z-doug[X-x,y] (doug*lerp+rdoug*(Z-lerp))/Z d (rdoug*lerp+doug*(Z-lerp))/Z d