Android Eclipse プロジェクト &php で 2 つの場所の間の距離を見つける方法。このプロジェクトは、オンラインの優れた輸送システムに基づいています。運送業者の運賃を調べる必要があるため、ソースと宛先の間の距離を見つける必要があります。Harversine 式は地域で最短の車両を見つけるために実装されました
2 に答える
0
float[] results = new float[1];
Location.distanceBetween(source.latitude, source.longitude,
destination.latitude, destination.longitude,
results);
2 つの場所の間のおおよその距離をメートル単位で計算し、必要に応じてそれらの間の最短経路の最初と最後の方位を計算します。距離と方位は、WGS84 楕円体を使用して定義されます。計算された距離は results[0] に格納されます。results の長さが 2 以上の場合、初期方位は results[1] に格納されます。results の長さが 3 以上の場合、最終的な方位は results[2] に格納されます。
@param startLatitude the starting latitude @param startLongitude the starting longitude @param endLatitude the ending latitude @param endLongitude the ending longitude @param results an array of floats to hold the results @throws IllegalArgumentException if results is null or has length < 1
于 2017-04-13T09:03:33.857 に答える