The 'worm in the hole' algorithm takes the sensor length offset value, and determines the point this specified distance back along the platform track. The metaphor is that a worm has opened a tunnel through a body of material. The sensor is being dragged through this tunnel, and we determine the sensor location accordingly.
This is not a perfect algorithm. In truth, during a turn the forces on a towed array will cause it to slip sideways, cutting off the corner to an extent. It is the responsibility of the analyst to appraise himself with array performance and determine the applicability of the worm in the hole algorithm - though note its results are much more accurate than the non-worm in the hole straight line model.
The screenshot belows shows a comparison of the two models. The red ownship track has positions at times 100,200,300 and 400. The sensor track has positions at times 100,140,280,350. The array is 400m long.
The two array models show the same value for the first 3 points plotted: in the first two of these the array falls behind the start of the ownship track - thus the reciprocal of ownship heading is necessary to determine the position. In the third position, the length of the 400m array falls completely within the 600m leg.
The fourth position is, however, different. The straight-line model plots it back along the reciprocal of the platform heading at time 300. The worm in the hole model, however, turns back along the ownship track from position 200 to 300. At time 350, the ownship platform will be 1/2 way down between positions 300 and 400 - this will consume 1/2 of the 600m separation (300m), leaving another 100m of array to be consumed - this the algorithm moves 100m back down between the points at 200 & 300.
The worm in the hole algorithm is implemented as follows:
Determine platform track, the time at which sensor location is required, the specified length offset, and whether the sensor is 'ticked' for 'worm in the hole algorithm'.
Work through the platform track to find the position immediately after the specified dtg, together with a list of points preceding that. These represent the 'nextPoint' and the backTrack from that dtg.
Calculate the platform position at the specified dtg by interpolating between the last item of the backTrack and the nextPoint , at the specified dtg. Name this new position nextPoint - it represents the platform position at the specified dtg
Now repeatedly perform the following:
Work out the distance from nextPoint to the last item in the backTrack
If this distance is greater than the remaining array offset length then:
Work out the proportion of the distance that the remaining sensor length represents, name it timeDelta
Interpolate back from nextPoint to the last item in the backTrack by the timeDelta parameter. This is the resultant sensor location
If the calculated distance is less than the remaining sensor length then
reduce the remaining sensor length by the calculated distance (to represent the array being 'consumed' by the backTrack)
if there are any more points in the backTrack then
store the last point on the backTrack as nextPoint, and move back along the backTrack by one element
calculate the offset back from the start of the platform track, of the remaining sensor length, along the reciprocal of the vessel heading. This is the resultant sensor location.