title: calculate overlap of two parallel lines
body: <p>I have 2 parallel lines in an 2D space.
  The lines are defined with $min1, $max1, $min2, $max2</p>
  
  <p>I already figured out how to check if they overlap:</p>
  
  <pre><code>function overlap($min1,$max1,$min2,$max2){
    if(($min1&lt;$min2 &amp;&amp; $max1&gt;$min2) 
      || ($min1&lt;$max2 &amp;&amp; $max1&gt;$max2) 
      || ($min1==$min2 &amp;&amp; $max1==$max2) 
      || ($min2&gt;=$min1 &amp;&amp; $max2&lt;=$max1)
      || ($min1&gt;=$min2 &amp;&amp; $max1&lt;=$max2)){
      return true;
  }
  return false;
  }
  </code></pre>
  
  <p>Now i have to check the overlaping length, but i have no idea how to implemnt this.</p>
  
  <p>i need this to get the minmal translation vector in a separating axis theorem implementation</p>
  
  <p>any hint would be great.</p>