Created
December 16, 2015 20:11
-
-
Save ralfbecher/a4c22c35ee2f3ab43d6f to your computer and use it in GitHub Desktop.
QlikView Haversine formula calculation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// calculation of distance of two geo references (lat/lon): | |
= 12742 * atan2(sqrt(sqr(sin(((lat2-lat1)*PI()/180)/2)) | |
+ (cos(lat1*PI()/180) * cos(lat2*PI()/180)) | |
* pow(sin(((lon2-lon1)*PI()/180)/2),2)), | |
sqrt(1 - (sqr(sin(((lat2-lat1)*PI()/180)/2)) | |
+ (cos(lat1*PI()/180) * cos(lat2*PI()/180)) | |
* pow(sin(((lon2-lon1)*PI()/180)/2),2)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment