Location.CalculateDistance 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
CalculateDistance(Location, Location, DistanceUnits)
計算兩個位置之間的距離。
public:
static double CalculateDistance(Microsoft::Maui::Devices::Sensors::Location ^ locationStart, Microsoft::Maui::Devices::Sensors::Location ^ locationEnd, Microsoft::Maui::Devices::Sensors::DistanceUnits units);
public static double CalculateDistance (Microsoft.Maui.Devices.Sensors.Location locationStart, Microsoft.Maui.Devices.Sensors.Location locationEnd, Microsoft.Maui.Devices.Sensors.DistanceUnits units);
static member CalculateDistance : Microsoft.Maui.Devices.Sensors.Location * Microsoft.Maui.Devices.Sensors.Location * Microsoft.Maui.Devices.Sensors.DistanceUnits -> double
Public Shared Function CalculateDistance (locationStart As Location, locationEnd As Location, units As DistanceUnits) As Double
參數
- locationStart
- Location
開始位置。
- locationEnd
- Location
結束位置。
- units
- DistanceUnits
傳回結果距離的單位。
傳回
所選單位中兩個位置之間的距離。
適用於
CalculateDistance(Location, Double, Double, DistanceUnits)
計算兩個位置之間的距離。
public:
static double CalculateDistance(Microsoft::Maui::Devices::Sensors::Location ^ locationStart, double latitudeEnd, double longitudeEnd, Microsoft::Maui::Devices::Sensors::DistanceUnits units);
public static double CalculateDistance (Microsoft.Maui.Devices.Sensors.Location locationStart, double latitudeEnd, double longitudeEnd, Microsoft.Maui.Devices.Sensors.DistanceUnits units);
static member CalculateDistance : Microsoft.Maui.Devices.Sensors.Location * double * double * Microsoft.Maui.Devices.Sensors.DistanceUnits -> double
Public Shared Function CalculateDistance (locationStart As Location, latitudeEnd As Double, longitudeEnd As Double, units As DistanceUnits) As Double
參數
- locationStart
- Location
開始位置。
- latitudeEnd
- Double
結束位置的緯度座標。
- longitudeEnd
- Double
結束位置的經度座標。
- units
- DistanceUnits
傳回結果距離的單位。
傳回
所選單位中兩個位置之間的距離。
適用於
CalculateDistance(Double, Double, Location, DistanceUnits)
計算兩個位置之間的距離。
public:
static double CalculateDistance(double latitudeStart, double longitudeStart, Microsoft::Maui::Devices::Sensors::Location ^ locationEnd, Microsoft::Maui::Devices::Sensors::DistanceUnits units);
public static double CalculateDistance (double latitudeStart, double longitudeStart, Microsoft.Maui.Devices.Sensors.Location locationEnd, Microsoft.Maui.Devices.Sensors.DistanceUnits units);
static member CalculateDistance : double * double * Microsoft.Maui.Devices.Sensors.Location * Microsoft.Maui.Devices.Sensors.DistanceUnits -> double
Public Shared Function CalculateDistance (latitudeStart As Double, longitudeStart As Double, locationEnd As Location, units As DistanceUnits) As Double
參數
- latitudeStart
- Double
開始位置的緯度座標。
- longitudeStart
- Double
開始位置的經度座標。
- locationEnd
- Location
結束位置。
- units
- DistanceUnits
傳回結果距離的單位。
傳回
所選單位中兩個位置之間的距離。
適用於
CalculateDistance(Double, Double, Double, Double, DistanceUnits)
計算兩 Location 個實例之間的距離。
public:
static double CalculateDistance(double latitudeStart, double longitudeStart, double latitudeEnd, double longitudeEnd, Microsoft::Maui::Devices::Sensors::DistanceUnits units);
public static double CalculateDistance (double latitudeStart, double longitudeStart, double latitudeEnd, double longitudeEnd, Microsoft.Maui.Devices.Sensors.DistanceUnits units);
static member CalculateDistance : double * double * double * double * Microsoft.Maui.Devices.Sensors.DistanceUnits -> double
Public Shared Function CalculateDistance (latitudeStart As Double, longitudeStart As Double, latitudeEnd As Double, longitudeEnd As Double, units As DistanceUnits) As Double
參數
- latitudeStart
- Double
開始位置的緯度座標。
- longitudeStart
- Double
開始位置的經度座標。
- latitudeEnd
- Double
結束位置的緯度座標。
- longitudeEnd
- Double
結束位置的經度座標。
- units
- DistanceUnits
傳回結果距離的單位。
傳回
所選單位中兩個位置之間的距離。