In the context of a game program, I have a moving circle and a fixed line segment. The segment can have an arbitrary size and orientation.
I am having difficulties trying to compute:
I'm going to answer with pseudo-algorithm - without any code. The way I see it there are two cases in which we might return true, as per the image below:
Here in blue are your circles, the dashed line is the trajectory line and the red line is your given line.
From the trajectory we build normal lines to each point A and B. Then these lines are chopped or extended into helper lines (Ha
and Hb
), so that their length from A
and B
is exactly the radius of the circle. Then we check if each of these helper lines intersects with the trajectory line. If they do return true.