code: September 2008 Archives
While building out my new lifestream, I ran into a wall, and needed a function to map a variable from one coordinate space (specifically arrays). I remembered that Proce55ing had just such a function. OpenSource Software FTW!
function map(value, istart, istop, ostart, ostop) {
return ostart + (ostop - ostart) * ((value - istart) / (istop - istart));}
