Until the inventions of the hedgehog, and RADAR capable to spotting a periscope, or the Wirlwind cracked Enigma code...
"The most dangerous enemy of the submarine is the aircraft, by reason of its great speed"
- Geheim! The Submarine Commander's Handbook
Though, it's not going to be easy, as planes generally fly smoothly, and to change direction on a spotted sub, and dive on it--is a quadradic equation.
: O Like this:
https://towardsdatascience.com/b%C3%A9zier-curve-bfffdadea212
Perhaps something like this B24