public PointLatLngAlt(PointLatLngAlt plla) { this.Lat = plla.Lat; this.Lng = plla.Lng; this.Alt = plla.Alt; this.color = plla.color; this.Tag = plla.Tag; }
/// <summary> /// Calc Distance in M /// </summary> /// <param name="p2"></param> /// <returns>Distance in M</returns> public double GetDistance(PointLatLngAlt p2) { double d = Lat * 0.017453292519943295; double num2 = Lng * 0.017453292519943295; double num3 = p2.Lat * 0.017453292519943295; double num4 = p2.Lng * 0.017453292519943295; double num5 = num4 - num2; double num6 = num3 - d; double num7 = Math.Pow(Math.Sin(num6 / 2.0), 2.0) + ((Math.Cos(d) * Math.Cos(num3)) * Math.Pow(Math.Sin(num5 / 2.0), 2.0)); double num8 = 2.0 * Math.Atan2(Math.Sqrt(num7), Math.Sqrt(1.0 - num7)); return (6378.137 * num8) * 1000; // M }