Homing missiles
BlitzMax Forums/BlitzMax Beginners Area/Homing missiles
| ||
Imagine a missile homing in on a moving target. To make sure it hits the target without overshooting it the missile can deccelerate to decrease its turning circle and eventually hit the target. How though would you calculate the angle of attack without decreasing speed, so that the missile hits the target at full speed? Remember that both the missile and target have their own velocities. |
| ||
Private Joker: How can you shoot women or children? Door Gunner: Easy! Ya just don't lead 'em so much! Ain't war hell? Basically, you calculate the time it takes the missile to travel the distance required, and figure out where the target will be at that time using it's current heading and speed. Depending on the degree of accuracy required you can make it more complicated. |
| ||
The tricky part in lead pursuit algorithms comes when the target is moving at an angle to the missile. The distance to the location of the target at the time of impact cannot be exactly calculated until you know the point of impact, and you don't know the point until you know the distance! Weird, huh? A way to guesstimate it is to make multiple iterations, getting closer and closer to the actual point of impact after each iteration, but not without the cost in code performance. It can be calculated precisely in one iteration, but it takes more than simple high school math to do so. Any takers? :) |
| ||
This may not really usefull though someone has posted example code on programming a homing missile. Have you had a look in the code archives, it should be there. |