https://letuscrack.com/function-calculatedistance/
Function calculateDistance