title: How to find maximum number of intersectionS through set of line segments
body: <p>Suppose I am given number of lines segments in Cartesian  coordinate system.Each line is given as [x0,y0] and [x1,y1].Algorithm should find a perpendicular that cross maximum number of lines.
  In this example it crosses four lines:</p>
  
  <p><img src="https://i.stack.imgur.com/1C0jL.png" alt="enter image description here"></p>
  
  <p>What algorithm can do it with minimum complexity?(i would prefer c++ but some kind of pseudo code is OK too)</p>
  
  <p>P.S The point to think about is when several lines start/end in the same x coordinate</p>
  
  <p>Thank you.</p>