ShahjalalShohag / code-library

Templates, algorithms and data structures implemented and collected for programming contests.
MIT License
2.85k stars 751 forks source link

fix point to convex polygon distance function #20

Closed st3inum closed 1 year ago

st3inum commented 1 year ago

1) find two tangents, from that point to the convex polygon 2) between those two tangent lines, ternary search to find the closest vertex 3) check the closest point for the two adjacent edge