Let's say I have a GameObject A
that's moving in a circular path in orbit around a central point, and I have a second GameObject B
that is capable of independent movement, and can move at a higher velocity than A
. B
may be located at an arbitrary point, either inside or outside of A
's orbit. I want to calculate the fastest route that will cause object B
to intercept object A
. (The problem is not exactly "I want a spaceship to arrive at a planet", but close enough for the purposes of this question.)
The obvious idea is to compute a bunch of concentric circles around B
and use some sort of divide-and-conquer guesswork to narrow in on a circle that ends up touching A
's orbit at exactly the point where A
would be if B
moved to that point at its maximum speed. But that feels a bit clunky, not to mention computationally expensive for something that I'd want to do fairly frequently, potentially multiple times per frame. Is there a better way to calculate this?
For simplicity's sake, assume that all calculations are occurring in a 2D plane.
t
(they are both circles, the radius of B's is determined by it's speed and the given time), and then solve them against each other for the intersection. But I've got half way with the maths and messed up - I'll have a rethink tonight, but hopefully somebody can write up the specific solution before then. \$\endgroup\$