11. Point-line distance

Write a program that determines the closest point and shortest distance between a point and a line. Let the user left-click twice to define the line and right-click once to define the point. Draw the line 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
18.117.137.12