python,numpy,intersection,euclidean-distance,line-intersection

Basic algorithm: pretend that you have lines, so oriented that A lies to the left of B. Find closest point as normal. If the point is between A and B, you're done. If it's to the left of A, the closest point is A. If the point is to the...

algorithm,computational-geometry,line-intersection,convex-polygon

Be careful not to neglect the case where Q entirely covers R, or vice versa, as the edge test then would give a false negative. One approach, conceptually: Regard R as the intersection of two axis-aligned infinite bands, a vertical band [x0,x1] and a horizontal band [y0,y1]. Let xmin and...