title: Intersection of a 2D segment with a rectangle
body: <p>I using C# and XNA. I need an algorithm in any language to obtain the border intersection point(s) of a rectangle with a 2d segment.</p>
  
  <p>I've been looking for an answer for my question for over 3 hours already and couldn't find a solution that works.</p>
  
  <p>Can anyone help me please?</p>
  
  <p>Thanks a lot.</p>