Collision Detection Between a Circle and a Line Segment

Collision between Segment AB and circle C (radius r).  Let’s remember a little of vector algebra and pythagorean theorem. The height of the right-angle triangle ACD is what we need to compare with radius. This...