mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-04-23 03:06:38 +00:00
add SatelliteDownloader
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
namespace SatelliteProvider;
|
||||
|
||||
public class GeoPoint
|
||||
{
|
||||
const double PRECISION_TOLERANCE = 0.00005;
|
||||
public double Lat { get; }
|
||||
public double Lon { get; }
|
||||
|
||||
public GeoPoint() { }
|
||||
|
||||
public GeoPoint(double lat, double lon)
|
||||
{
|
||||
Lat = lat;
|
||||
Lon = lon;
|
||||
}
|
||||
|
||||
public override string ToString() => $"{Lat:F4}, {Lon:F4}";
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is not GeoPoint point) return false;
|
||||
return ReferenceEquals(this, obj) || Equals(point);
|
||||
}
|
||||
|
||||
private bool Equals(GeoPoint point) =>
|
||||
Math.Abs(Lat - point.Lat) < PRECISION_TOLERANCE && Math.Abs(Lon - point.Lon) < PRECISION_TOLERANCE;
|
||||
|
||||
public override int GetHashCode() => HashCode.Combine(Lat, Lon);
|
||||
|
||||
public static bool operator ==(GeoPoint left, GeoPoint right) => Equals(left, right);
|
||||
public static bool operator !=(GeoPoint left, GeoPoint right) => !Equals(left, right);
|
||||
}
|
||||
Reference in New Issue
Block a user