This question evaluates understanding of computational geometry and numerical robustness, testing the ability to compute Euclidean distances between a point and a line segment using analytic geometry concepts.
Given a 2D point P(x, y) and a line segment with endpoints A(x1, y1) and B(x2, y2), compute the minimum Euclidean distance from point P to the segment AB.
min(dist(P, A), dist(P, B))
.
dist(P, A)
).
[-1e9, 1e9]
).