Knowing how to find the closest point on a line segment to another point, animate randomly moving line segments and circle. Color the lines in different colors when they intersect with the circle.
Daily Archives: 06/10/2019
Closest Point On a Line Segment to Another Point
Write a program that finds the closest point of a line segment to another point. Randomly pick a point and color it in blue. Also, randomly generate several lines. Find the closest points on these lines to the blue point and mark these closest points in red as show in the picture below:
What’s next?
Intersecting Lines with a Circle