Difference between revisions of "AppInventor: Menghitung Jarak dan Arah dari GPS"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
Line 1: | Line 1: | ||
Sumber: https://sites.google.com/site/appinventor/distance-based-on-lat-long | Sumber: https://sites.google.com/site/appinventor/distance-based-on-lat-long | ||
+ | |||
+ | ==Menghitung Jarak== | ||
+ | |||
+ | Jarak: | ||
distance = sqrt(x^2 + y^2) | distance = sqrt(x^2 + y^2) | ||
Line 7: | Line 11: | ||
x = 69.1 * (lat2 - lat1) | x = 69.1 * (lat2 - lat1) | ||
y = 69.1 * (lon2 - lon1) * cos(lat1/57.3) | y = 69.1 * (lon2 - lon1) * cos(lat1/57.3) | ||
+ | |||
+ | |||
+ | ==Menghitung Arah== | ||
+ | |||
+ | Arah: | ||
+ | |||
+ | β = atan2(X,Y), | ||
+ | |||
+ | Dimana | ||
+ | |||
+ | X = cos θb * sin ∆L | ||
+ | Y = cos θa * sin θb – sin θa * cos θb * cos ∆L | ||
+ | |||
Line 13: | Line 30: | ||
* https://sites.google.com/site/appinventor/distance-based-on-lat-long | * https://sites.google.com/site/appinventor/distance-based-on-lat-long | ||
+ | * http://www.igismap.com/formula-to-find-bearing-or-heading-angle-between-two-points-latitude-longitude/ |
Revision as of 17:15, 10 October 2015
Sumber: https://sites.google.com/site/appinventor/distance-based-on-lat-long
Menghitung Jarak
Jarak:
distance = sqrt(x^2 + y^2)
Dimana:
x = 69.1 * (lat2 - lat1) y = 69.1 * (lon2 - lon1) * cos(lat1/57.3)
Menghitung Arah
Arah:
β = atan2(X,Y),
Dimana
X = cos θb * sin ∆L Y = cos θa * sin θb – sin θa * cos θb * cos ∆L