public double GetLLMDistance(double x1, double y1, double x2, double y2)
		{

			LatLng p1 = new FloatLatLng(x1, y1);
			LatLng p2 = new FloatLatLng(x2, y2);
			return p1.ArcDistance(p2, DistanceUnits.MILES);
		}
Esempio n. 2
0
        public override LatLng Normalize()
        {
            if (IsNormalized())
            {
                return(this);
            }

            double delta = 0;

            if (_lng < 0)
            {
                delta = 360;
            }
            if (_lng >= 0)
            {
                delta = -360;
            }

            double newLng = _lng;

            while (newLng <= -180 || newLng >= 180)
            {
                newLng += delta;
            }

            var ret = new FloatLatLng(_lat, newLng)
            {
                _normalized = true
            };

            return(ret);
        }
Esempio n. 3
0
		public override LatLng Normalize()
		{
			if (IsNormalized()) return this;

			double delta = 0;
			if (_lng < 0) delta = 360;
			if (_lng >= 0) delta = -360;

			double newLng = _lng;
			while (newLng <= -180 || newLng >= 180)
			{
				newLng += delta;
			}

			var ret = new FloatLatLng(_lat, newLng)
			          	{
			          		_normalized = true
			          	};
			return ret;
		}