CalculateDistanceToField: module and algo