Send to a Friend

Zyx's avatar

Programming/math question, please see inside (if you're a math wizard)

Asked by Zyx (4170points) February 25th, 2013

I’m writing a tower defence game because I love tower defence games but I ran into some serious problems when I decided my projectiles needed to lead the target perfectly. So we have a moving target on the screen and a tower which would normally fire bullets but in my game the bullets orbit the tower until they are ready to be fired. That means I can’t fire them as soon as they’re in range of the tower, I have to wait until the bullet faces in the right direction to intercept the target.

Ok, so I have 3 objects: A, B and C.

A and C are in motion, B is stationary. A is in orbit of B and the path of C is known. A can escape from its orbit instantly and if it does it drifts in a straight line. How do I find the first possible moment at which the target and the bullet could collide?

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.