[ a = \frac2 h v^2d^2 ]

[ h = \frac12 a t^2 ] [ d = v t ]

[ \textLead angle \theta = \arctan\left( \fracv_\textlateralv_\texttorpedo \right) ]

Eliminate (t):

[ h = \frac12 a \left( \fracdv \right)^2 ]

No lateral motion needed if flying straight down the trench centerline — but if the port is offset, or the X-wing is drifting:

x trench run math