2009/3/9, Justin Yang <jyang03@xxxxxxxxx>:
A basics question here. Is there a simple way to do mapping/
normalizing - as x goes from 0-1 map a1 to z1 into a2 to z2?
Not completely sure if I understand you correctly but
SimpleNumber:linlin(inMin, inMax, outMin, outMax, clip) might help?
Maps a linear range onto a different linear range.
15.linlin(10, 20, 44, 45) // gives 44.5
There's also linexp and explin, which map to/from exponential scales.
And is there a way to interpolate between arrays - as x goes from
0-1 [1, 2.33, 4.01, 7] goes to [15, 96.8, 301, 987.44]?
blendAt:
[[1, 2.33, 4.01, 7], [15, 96.8, 301, 987.44]].blendAt(0.5)
HTH
Dan
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/