57 lines
1.3 KiB
C#
57 lines
1.3 KiB
C#
|
using System.Diagnostics;
|
|||
|
|
|||
|
namespace Plane.Geography
|
|||
|
{
|
|||
|
[DebuggerDisplay("lat: {Latitude}, lng: {Longitude}, alt: {Altitude}")]
|
|||
|
public class PLLocation : ILocation
|
|||
|
{
|
|||
|
public PLLocation()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public PLLocation(ILocation locToCopy)
|
|||
|
: this(locToCopy.Latitude, locToCopy.Longitude, locToCopy.Altitude)
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public PLLocation(double lat, double lng, float alt)
|
|||
|
{
|
|||
|
Latitude = lat;
|
|||
|
Longitude = lng;
|
|||
|
Altitude = alt;
|
|||
|
}
|
|||
|
|
|||
|
public float Altitude { get; set; }
|
|||
|
|
|||
|
public double Latitude { get; set; }
|
|||
|
|
|||
|
public double Longitude { get; set; }
|
|||
|
|
|||
|
public PLLocation AddAltitude(float altToAdd)
|
|||
|
{
|
|||
|
Altitude += altToAdd;
|
|||
|
return this;
|
|||
|
}
|
|||
|
|
|||
|
public PLLocation AddLatitude(double latToAdd)
|
|||
|
{
|
|||
|
Latitude += latToAdd;
|
|||
|
return this;
|
|||
|
}
|
|||
|
|
|||
|
public PLLocation AddLatLngAlt(double latToAdd, double lngToAdd, float altToAdd)
|
|||
|
{
|
|||
|
Latitude += latToAdd;
|
|||
|
Longitude += lngToAdd;
|
|||
|
Altitude += altToAdd;
|
|||
|
return this;
|
|||
|
}
|
|||
|
|
|||
|
public PLLocation AddLongitude(double lngToAdd)
|
|||
|
{
|
|||
|
Longitude += lngToAdd;
|
|||
|
return this;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|