title: Getting coordinates perpendicular to AB
body: <p><img src="https://i.stack.imgur.com/QMtIP.png" alt="enter image description here"></p>
  
  <p>I already posted this question <a href="https://stackoverflow.com/questions/27251745/finding-closest-90-degree-angle-spot/27266884?noredirect=1#comment43980058_27266884">here</a></p>
  
  <p>And I got the solution thanks to Fang but the problem is that the coordinates I need to use are GPS coordinates and apparently GPS needs a different formula than cartesian.</p>
  
  <p>So I am working with Google Maps APIv3 polygons and having coordinates of AB (by drawing them with the polygon tool) I click on position C which I need to be moved to D which is perpendicular to AB and CD is parallel to AB</p>
  
  <p>So the question would be:</p>
  
  <pre><code>Having
  A = 50.88269282423443,6.0036662220954895
  B = 50.882753744583226,6.003803014755249
  C = 50.88252571592428, 6.003832183778286
  
  - D is perpendicular to AB
  - CD is parallel to AB
  </code></pre>
  
  <p>What would be the formula to get D</p>
  
  <p>I've been trying a long time to figure it out but no succes so far.</p>