Missiles lead collision/proportional navigation

Community Forums/Showcase/Missiles lead collision/proportional navigation

Flanker512(Posted 2015) [#1]
Hi, I've been playing with lead collision course (called proportional navigation in missiles) and I recently came across a simple solution with trigonometry that I wanted to share.

Lead collision course is well known by sailors to avoid collision with other ships. The rule is quite simple, if your ship gets closer to another ship, and if the other ship stays at the exact same angle, you are on a collision course.

This is also used to guide modern missiles (in fact modern missiles are a lot more complex). It makes a missile far more effective than pure pursuit (simply following the target). Impact probality is improved on maneuvering targets, fuel consumption is optimised (increasing the missile range), and viewed from the target, the missile stays at the same angles, making it hard to spot.

I explain the trigonometry procedure I came across in an image :

Click here for full size image

Here is the code in two functions for 3d (for 2d just consider z=0) :


Just call LeadCollision with proper parameters and get your lead collision vector in leadCol_vx#,leadCol_vy#,leadCol_vz# variables. You can also find the impact point (approximative). It can be useful for a missile for example, to see if the impact point is not in the ground...

And finally, here is an example in use with Blitz3D, comparing proportional navigation with pure pursuit : Download archive
Both missiles are exactly the same physically (turn rate, cone angle, speed, acceleration...), just the guidance is different, and you'll see the difference of effectiveness. Sorry for the explosions, they are not optimised (simple bunch of sprites), so it can drop fps...

Hope it can help, I didn't find this kind of stuff in the code archive.


Flanker(Posted 2015) [#2]
A little screenshot from the example downloadable above :



Pingus(Posted 2015) [#3]
Waow ! If I had knew that when I was making action games ! I'll try to keep in mind this method which can be usefull.


Flanker(Posted 2015) [#4]
Yes it can be useful, better than aproximating the impact point with lots of iterations (that was the method I used before...).


Floyd(Posted 2015) [#5]
That calls a function, Distance3D, which is not included. No doubt something like this.
Function Distance3D#( x1#,y1#,z1#, x2#,y2#,z2# )
	Return Sqr( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1) )
End Function



Flanker(Posted 2015) [#6]
Yes, exactly Floyd, forgot to include it.


Volturna(Posted 2015) [#7]
Very nice and simple code! Was looking for something like that for homming missiles and cannon firing (shooting at future position instead of actual target coords).

Thank you for the post.


Blitzplotter(Posted 2015) [#8]
whoa, very interesting post, thanks for sharing.


Flanker512(Posted 2015) [#9]
I've been looking for this for a while too ! Finally with a pen and a paper I found this trigonometry method, wich in the end is an application of the Thales theorem.