C# Class WebApplications.Utilities.Location.LatLng

Stores the Latitude/Longitude of a point.
ファイルを表示 Open project: webappsuk/CoreLibraries Class Usage Examples

Public Properties

Property Type Description
Latitude double
Longitude double

Public Methods

Method Description
Distance ( LatLng pointOne, LatLng pointTwo, DistanceCalculation calculation = DistanceCalculation.LawOfCosines ) : double

Calculates the distance (in km) between two specified latlong points. By default this uses the Law of Cosines formula (http://en.wikipedia.org/wiki/Law_of_cosines).

DistanceTo ( LatLng otherPoint, DistanceCalculation calculation = DistanceCalculation.LawOfCosines ) : double

Calculates the distance (in km) between the current point and the point specified. By default this uses the Law of Cosines formula (http://en.wikipedia.org/wiki/Law_of_cosines).

LatLng ( double latitude, double longitude ) : System

Initialises a new instance of the LatLng class.

MidPoint ( LatLng pointOne, LatLng pointTwo ) : LatLng

Calculates the midpoint between two specified latlong points.

MidpointTo ( LatLng otherPoint ) : LatLng

Calculates the midpoint between the current point and the point specified.

ToString ( ) : string

Returns a string that represents this instance.

Method Details

Distance() public static method

Calculates the distance (in km) between two specified latlong points. By default this uses the Law of Cosines formula (http://en.wikipedia.org/wiki/Law_of_cosines).
/// The specified is outside the allowable values. ///
public static Distance ( LatLng pointOne, LatLng pointTwo, DistanceCalculation calculation = DistanceCalculation.LawOfCosines ) : double
pointOne LatLng The first point to use in the calculation.
pointTwo LatLng The second point to use in the calculation.
calculation DistanceCalculation /// The calculation to use. /// By default this uses the Law of Cosines formula. ///
return double

DistanceTo() public method

Calculates the distance (in km) between the current point and the point specified. By default this uses the Law of Cosines formula (http://en.wikipedia.org/wiki/Law_of_cosines).
/// The specified is outside the allowable values. ///
public DistanceTo ( LatLng otherPoint, DistanceCalculation calculation = DistanceCalculation.LawOfCosines ) : double
otherPoint LatLng The point we want to calculate the distance to.
calculation DistanceCalculation /// The distance calculation to use. /// By default this uses the Law of Cosines formula. ///
return double

LatLng() public method

Initialises a new instance of the LatLng class.
public LatLng ( double latitude, double longitude ) : System
latitude double The Latitude of the point.
longitude double The Longitude of the point.
return System

MidPoint() public static method

Calculates the midpoint between two specified latlong points.
public static MidPoint ( LatLng pointOne, LatLng pointTwo ) : LatLng
pointOne LatLng The first point to use in the calculation.
pointTwo LatLng The second point to use in the calculation.
return LatLng

MidpointTo() public method

Calculates the midpoint between the current point and the point specified.
public MidpointTo ( LatLng otherPoint ) : LatLng
otherPoint LatLng The other point to use in the calculation.
return LatLng

ToString() public method

Returns a string that represents this instance.
public ToString ( ) : string
return string

Property Details

Latitude public_oe property

The Latitude of the point.
public double Latitude
return double

Longitude public_oe property

The Longitude of the point.
public double Longitude
return double