Beispiel #1
0
        public bool Equals(LocationCoordinates lc)
        {
            if ((Object)lc == null)
            {
                return(false);
            }

            return(this.Latitude == lc.Latitude &&
                   this.Longitude == lc.Longitude);
        }
Beispiel #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            // If parameter cannot be cast to Routine return false.
            LocationCoordinates r = obj as LocationCoordinates;

            return(this.Equals(r));
        }
        public override async Task Refresh(LocationCoordinates location, double radius_miles)
        {
            await Task.Delay(500);

            List <ItemReport> item_reports =
                new List <ItemReport>(LocalItemReports);

            EditableLocalItemReports.Clear();
            foreach (ItemReport ir in item_reports)
            {
                EditableLocalItemReports.Add(ir);
            }
        }
Beispiel #4
0
        public double DistanceTo(LocationCoordinates lc, DistanceUnits units)
        {
            const double EarthRadiusKm = 6371.0;
            const double EarthRadiusMi = 3959.0;
            double       radius        =
                (units == DistanceUnits.Kilometers ? EarthRadiusKm : EarthRadiusMi);

            double dLat_rads  = DegreesToRadians(lc.Latitude - Latitude);
            double dLong_rads = DegreesToRadians(lc.Longitude - Longitude);

            double a = Math.Pow(Math.Sin(dLat_rads / 2), 2) +
                       Math.Cos(DegreesToRadians(Latitude)) *
                       Math.Cos(DegreesToRadians(lc.Latitude)) *
                       Math.Pow(Math.Sin(dLong_rads / 2), 2);

            double c = 2 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a));

            return(radius * c);
        }
Beispiel #5
0
 public abstract Task Refresh(LocationCoordinates location, double radius_miles);
Beispiel #6
0
 public override async Task Refresh(LocationCoordinates location, double radius_miles)
 {
     throw new NotImplementedException();
 }
Beispiel #7
0
 public LocationCoordinatesEventArgs(LocationCoordinates location_coords)
 {
     this.LocationCoordinates = location_coords;
 }