title: When drawing an arbitrary point in an image, how to find the coordinates of the two closest lines perpendicular to that point?
body: <p><a href="https://i.stack.imgur.com/XJUQU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XJUQU.png" alt="enter image description here" /></a></p>
  <p>I draw an arbitrary point in this image.</p>
  <p>I want to find the coordinates of the two lines closest to this point.</p>
  <p><strong>It should be a straight line when you connect one of the two points to any point.</strong></p>
  <p>Like this :</p>
  <p><a href="https://i.stack.imgur.com/iNLzE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iNLzE.jpg" alt="enter image description here" /></a></p>
  <blockquote>
  <p><strong>I want to know two thing</strong></p>
  <ul>
  <li><p><strong>First, Is there a library to find the nearest line from  an arbitrary point?</strong></p>
  </li>
  <li><p><strong>Second, Is there any library or algorithm to find a point perpendicular to an arbitrary point?</strong></p>
  </li>
  </ul>
  </blockquote>
  <p>Please help me.....</p>