12 |
latitude=lat; |
latitude=lat; |
13 |
longitude=lng; |
longitude=lng; |
14 |
} |
} |
15 |
|
|
16 |
public static double beregnAfstand(GeoPoint point1, GeoPoint point2) { |
//Denne er alt for upræcis |
17 |
|
@Deprecated |
18 |
|
public static double beregnAfstand_old(GeoPoint point1, GeoPoint point2) { |
19 |
//(62.8*sqrt(3.1*(Power(a.Latitude-x.Latitude,2)+Power(a.Longitude-x.Longitude,2)))) as Afstand, |
//(62.8*sqrt(3.1*(Power(a.Latitude-x.Latitude,2)+Power(a.Longitude-x.Longitude,2)))) as Afstand, |
20 |
|
|
21 |
|
|
25 |
return 62.8 * Math.sqrt( 3.1 * (pwrLat + pwrLng) ); |
return 62.8 * Math.sqrt( 3.1 * (pwrLat + pwrLng) ); |
26 |
} |
} |
27 |
|
|
28 |
public static float beregnAfstand2(GeoPoint p1, GeoPoint p2) { |
public static float beregnAfstand(GeoPoint p1, GeoPoint p2) { |
29 |
float[] result = new float[1]; |
float[] result = new float[1]; |
|
|
|
30 |
|
|
31 |
computeDistanceAndBearing(p1.latitude, p1.longitude, p2.latitude, p2.longitude, result); |
computeDistanceAndBearing(p1.latitude, p1.longitude, p2.latitude, p2.longitude, result); |
32 |
|
|
33 |
return result[0]; |
return (result[0] / 1000.0f); |
34 |
} |
} |
35 |
|
|
36 |
|
|