title: given two points how can I determine if a rectangle will pass through a line joining the points
body: <p>In my code below I have two points <code>point1</code> and <code>point2</code> and a <code>rectangle</code>. Generally I would like to know how to determine if a line from both points would pass through the rectangle.</p>
  
  <pre><code>var point1 = CGPoint(x: screenSize.width/4,y: screenSize.height/4)
  var point2 = CGPoint(x: 3*screenSize.width/4,y: 3*screenSize.height/4)
  var rectangle = CGRect(x: sprite.position.x, y: sprite.position.x/2, width: sprite.frame.width, height: sprite.frame.height))
  </code></pre>