Well probably find direction of sub. Estimate direction of target. Find angle from sub to target by periscope (they had compass markings on the inside, so if you pointed 10 degrees one way you could instantly tell you were 10 degrees from center). Then given speeds and times adjust where/when you have to fire so that the time to target covers the proper distance to target. It's easy enough, in theory.
Say you've got a ship going 20kts, and a sub going 18kts. Ship is on constant heading, sub is parallel and following.
Hypothetically the captain figures that at this range (say, 2000 yards) the 30mph torpedo will take 15 seconds to reach target.
Well then they just have to find "at what angle, but the same distance, will we need to fire to intercept the patch of this ship in 15 seconds"?
That kind fo stuff.
EDIT: If you're looking for actual equations and whatnot I don't have 'em. They might have just drawn on maps with grease pens.