title: Draw perpendicular line of fixed length at a point of another line
body: <p>I have two points A (10,20) and B (15,30). The points generate a line AB. I need to draw a perpendicular line, CD, on point B with a length of 6 (each direction 3 units) in Python. </p>
  
  <p>I already have some properties of line AB using the following code:</p>
  
  <pre><code>from scipy import stats
  x = [10,15]
  y = [20,30]
  slope, intercept, r_value, p_value, std_err = stats.linregress(x,y)
  </code></pre>
  
  <p>How can I calculate the location of C and D. I need their X and Y value. 
  <a href="https://i.stack.imgur.com/kjiSZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kjiSZ.png" alt="enter image description here"></a></p>
  
  <p>The value of C and D will be used for accomplishing another objective using the Shapely library. </p>