This repository has been archived on 2021-04-30. You can view files and clone it, but cannot push or open issues or pull requests.
blazing-workshop/BlazingPizza.Shared/LatLong.cs

28 lines
746 B
C#
Raw Normal View History

2020-12-17 15:52:43 +00:00
namespace BlazingPizza
{
public class LatLong
{
public LatLong()
{
}
public LatLong(double latitude, double longitude) : this()
{
Latitude = latitude;
Longitude = longitude;
}
public double Latitude { get; set; }
public double Longitude { get; set; }
public static LatLong Interpolate(LatLong start, LatLong end, double proportion)
{
// The Earth is flat, right? So no need for spherical interpolation.
return new LatLong(
start.Latitude + (end.Latitude - start.Latitude) * proportion,
start.Longitude + (end.Longitude - start.Longitude) * proportion);
}
}
}