How to calculate distance from path? : I have 2 coordinates (A1 and A2), connected by a straight line (my path). How can I calculate the distance of a given coordinate (B1 and B2) 90 degrees from the straight line?

[![A1 and A2 connected by straight line][1]][1]


  [1]: https://i.stack.imgur.com/YKu7q.png