Distance traveled to determine speed

Yes. Haversines formula always for long distances and the result shows the distance along the ortho. The blocks I pasted are for local distances only - and the result is measured along the loxo.

TLDR the blocks I pasted should never be used for long distances. And beyond about 30 miles a difference will start being noticed between the results of the two formulas.