Hello all,
I am looking find the closest point on the line in the below image to each of the points shown by a circle.
I have 2 tables, one I will call line, and one I will call point:
line.x = [1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5]line.y = [1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5]point.x = [4.5, 2.1, 3.6]point.y = [3.9, 2.7, 3.1]scatter(point.x, point.y)hold onplot(line.x, line.y)
I want to find the closest defined point on the line (it has to be one of the points listed above, it can't be a point on the line between the defined points) that is closest to each of the circles.
Any tips on how to do this? I have found several similar threads but nothing that gets at what I'm after. Thanks all!!
Best Answer