The stampede happened in April 2012 when a hot air balloon carrying a party of sightseers flew over Low Moor Farm, near York.
The pigs had been in their pens but were so terrified by the sight of the red-and-white-striped balloon and the noise from its burners that they charged through fences, stampeded 200 yards and ended up in a ditch at the end of the field.
Because pigs had been frightened in the past, the farm is listed with the Civil Aviation Authority.
Hot air balloons are banned from flying lower than 1,500ft over it or closer than 1,500ft to it. On this occasion, Mr Gilbank - who has run the farm with his father for 16 years - suspected the offending balloon had breached these limits as it soared over the North Yorkshire countryside.
He said it was "so low it had to put the burners on to get over the trees" and that as a result his pigs had run "like lemmings off a cliff".
But the balloon's operators, Wiltshire-based Go Ballooning, insisted it had come no closer than 2,500ft to the farm. Insurers for the company used GPS data generated during the flight to back their claim that it could not have caused the stampede.
However, the wife of a neighbouring farmer had by chance taken a photograph of the balloon. Low Moor Farm's owners, Ian Mosey (Livestock) Ltd, called in Chris Fewster, a professor of mathematics at the University of York.
Professor Fewster used trigonometry - the branch of maths that deals with the size and angles of triangles - to show that the balloon had been at a height of only about 100ft and had been less than 1,000ft from the pigs when it fired its burner.
He was helped in his calculations by Mr Gilbank, who used his laser rangefinder - a golfer's tool to measure the distance to the green - to work out the height of the trees. As a result, the insurers, who had initially offered £10,000 (NZ$20,294) compensation, have now agreed a settlement of £38,782 (NZ$78,656)
Yesterday Professor Fewster said that the data he was able to obtain from the photograph was vital. "Putting all of that together with fairly elementary mathematics, nothing too difficult, we got to the answer," he said.
Solicitor Darren Morgan said: "The exact position of the hot air balloon would have been almost impossible to prove without both the initial photographic evidence and the calculations from Professor Fewster. It's the first time in 20-odd years of practice that I've had to use a maths expert."
The balloon company, also known as Cameron Flights Southern Limited, went into liquidation last year.
- Daily Mail