Calculate distance travelled

HAVERSINE ALTERNATIVE USING SPHERICAL LAW OF COSINES

it has come to my attention that i had mistakenly posted a thunkable solution for calculating distance between 2 points on the globe as the haversine formula (i even mispelled it as havesine!). i went back to my sources and discovered that what i had posted was a simpler way of computing the same distance using the spherical laws of cosines. the results may be off by a mile or so when compared to the haversine formula, but they’re mostly pretty close.

in fact, it can be expressed as a oneliner (without using a square function, or square root, or atan that are present in haversine):

D=ACOS(SIN(LAT1)*SIN(LAT2)+COS(LAT1)*COS(LAT2)*COS(LON2-LON1))*3961

where 3961 is the radius of the earth in miles (use the equivalent 6373 in kilometers). Also note that the difference between the LAT values is not part of the formula.

when i was playing with this in may i also noticed that the trigonometric functions in thunkable rely on angles being expressed in degrees. hence where you expect radians, thunkable actually needs degrees. it’s an important thing to remember.

here’s the link to the new version (remember it’s a haversine replacement!):
https://x.thunkable.com/copy/0a769291e941b464b63f836aa39930e1

if anyone is interested, i’ve included link to an exerciser spreadsheet. just enter the lat/ long points at top and get the result in cell marked DISTANCE

3 Likes