Mapping a value in python
Revision as of 12:04, 20 March 2017 by Michael Murtaugh (talk | contribs) (Created page with " <source lang="python"> def map (v, inlow, inhigh, outlow, outhigh): p = (float(v) - inlow) / inhigh return outlow + (p * (outhigh - outlow)) </source>")
def map (v, inlow, inhigh, outlow, outhigh):
p = (float(v) - inlow) / inhigh
return outlow + (p * (outhigh - outlow))