title: Simple easing function in javascript
body: <p>I'm having trouble figuring out this simple math problem. I have spent over two hours reading through various related answers on SO and Google, but it seems my high school math knowledge is gone.</p>
  
  <p>On the page I have an element, that, once it passes a threshold, gets scaled down, the closer it gets to the edge of the containing element. Right now, it scales in a linear fashion. I calculate the distance to the container's edge, compare it to the <strong>threshold value</strong> (where the scale is 100%) and calculate a <strong>percentage</strong> from that, that is used to actually scale the Element (via CSS transform).</p>
  
  <p>What I would like, is for the scaling to start slowly for about the first 60-80% and then ramp up considerably.</p>
  
  <p>To me it seems I need some sort of inverse exponential or logarithmic function to do this, but I can't figure out exactly how to implement this. Ideally, the function would return <code>0.0</code> for <code>x = threshold</code> and <code>1.0</code> for <code>x = 0</code> (where x would be the element's current position/percentage).</p>
  
  <p>Any help is appreciated. I think this is probably trivial, but I cannot wrap my head around it.</p>