Closest circle intersection within a triangle (Context I use a Delaunay triangulation for pathfinding, and have circular points of interest, of varying sizes, being randomly placed around the map. Units need to be able to determine the closest such point of interest to path to, using a Dijkstra search across the triangulation.) Given a triangle, and a set of circles which overlap or intersect it, I'm trying to find the closest circle to a given point within the triangle. My first thought was to just take the distance from the point to each circle center, minus the radius. But there are some cases where that does not give the correct result. See the following image Measuring from point P within the triangle, to circles A and B. Using only the radius of each circle, as with d1 and d2, would result in circle A being considered closest. However, the closest edge of circle A used to measure d1 is outside of the triangle. Staying within the triangle, the closest edge from point P to circle A would be d3, which is much further away than d2, indicating that circle B is actually closest within the triangle. Is there a method for determining this difference, finding d3 for circles where d1 would be outside the triangle? How do you determine the intersection point between circle A and the triangle?