title: How does the map() function in Processing work?
body: <p>I'm taking a class which uses Processing.</p>
  <p>I having a problem understanding the map() function.</p>
  <p>According to it's documentation(<a href="http://www.processing.org/reference/map_.html" rel="noreferrer">http://www.processing.org/reference/map_.html</a>):</p>
  <blockquote>
  <p>Re-maps a number from one range to another.</p>
  <p>In the first example above, the number 25 is converted from a value in the range of 0 to 100 into a value that ranges from the left edge of the window (0) to the right edge(width).</p>
  <p>As shown in the second example, numbers outside of the range are not clamped to the minimum and maximum parameters values, because out-of-range values are often intentional and useful.</p>
  </blockquote>
  <p>Is is similar to a random function but the range is set by the user? Also, i cant understand the explanation for the first example: it says the number is converted to a value of 0 to 100 into a value that ranges from edge to edge of the screen. im thinking why not just convert directly, the number 25 to the range of value pertaining to the screen?</p>