12. Point-segment distance

Write a program that determines the closest point and shortest distance between a point and a line segment. Let the user left-click twice to define the segment and right-click once to define the point. Draw the segment and point, and a dashed line showing the shortest distance, as shown in the following screenshot:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.90.182