Oh man that is topic that is taught in naval academy. It's basically a trig calculator. You need two basic pieces of information...
The target ships AOB
And
The target ship speed
The range is to time impact.
Check out this link
http://www.subsim.com/radioroom/showthread.php?t=96026