ADDED INFORMATION:
I assume that this monster has a distance D to the tower, moves along the shortest path to the tower, and the tower begins to turn towards the monster. This is the situation at t=0 .
FIXED TYPES:
If your tower rotates at angular omega , that is, the angle phi at time t is
phi = omega * t
So, if you know that your tower should rotate the phi angle, the bullet will shoot at
t = phi/omega
From this, at a distance traveled by bullet v ,
s(t) = v * (t-phi/omega)
If your monster moves at vm , the monster will be at a distance d
d(t) = D - vm * t
A bullet hits a monster if
s(t) = d(t)
This equation is easy to solve: just replace d(t) and s(t) and rearrange the terms to get t :
t = (D + v * phi/omega) / (phi/omega + vm)
And the bullet will pass s(t) at that moment. If this value is negative, the monster was too fast and reached the tower before the bullet was fired.
source share