title: Rotate line with two points
body: <p>I have line with two points</p>
  
  <pre><code>(x1, y1) (x2, y2)
  </code></pre>
  
  <p>and I am working on x+, y+ plane only</p>
  
  <p>and say this line is vertical say</p>
  
  <pre><code>(320, 320) (320, 160)
  </code></pre>
  
  <p>How do I rotate it by 90 degrees to get</p>
  
  <pre><code>(320, 320) (480, 320)  [90 deg rotated by bottom point (320, 320)]
  (320, 160) (480, 160)  [90 deg rotated by top point (320, 160)]
  </code></pre>
  
  <p>Remember I would need in same form—i.e, </p>
  
  <pre><code>(x1, y1) (x2, y2)
  </code></pre>
  
  <p>By the way, these lines can only be vertical or horizontal, so the slope is either undefined or zero.</p>