共用方式為


Location.CalculateDistance 方法

定義

多載

CalculateDistance(Location, Location, DistanceUnits)

計算兩個位置之間的距離。

CalculateDistance(Location, Double, Double, DistanceUnits)

計算兩個位置之間的距離。

CalculateDistance(Double, Double, Location, DistanceUnits)

計算兩個位置之間的距離。

CalculateDistance(Double, Double, Double, Double, DistanceUnits)

計算兩 Location 個實例之間的距離。

CalculateDistance(Location, Location, DistanceUnits)

來源:
Location.shared.cs
來源:
Location.shared.cs

計算兩個位置之間的距離。

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)

來源:
Location.shared.cs
來源:
Location.shared.cs

計算兩個位置之間的距離。

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)

來源:
Location.shared.cs
來源:
Location.shared.cs

計算兩個位置之間的距離。

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.shared.cs
來源:
Location.shared.cs

計算兩 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

傳回結果距離的單位。

傳回

所選單位中兩個位置之間的距離。

適用於