title: Value Remapping
body: <p>Processing has a great function I use all the time:</p>
  
  
  
  <pre class="lang-java prettyprint-override"><code>map(value, low1, high1, low2, high2)
  </code></pre>
  
  <p><a href="http://processing.org/reference/map_.html" rel="noreferrer">http://processing.org/reference/map_.html</a></p>
  
  <p>It remaps <code>value</code> (that has an expected range of <code>low1</code> to <code>high1</code>) into a target range of <code>low2</code> to <code>high2</code>).</p>
  
  <p>I want to understand the math behind it so I can use it in other languages.
  Anyone want to throw me a bone and help me reverse engineer it?  I understand that it's a lerp that's been re-scaled and re-offset... feeling brain dead this morning.</p>