Esempio n. 1
0
        /// <summary>
        /// Convert the lat/lng into the cartesian coordinate plane such that all
        /// world coordinates are represented in the first quadrant.
        /// The x dimension corresponds to latitude and y corresponds to longitude.
        /// The translation starts with the normalized latlng and adds 180 to the latitude and
        /// 90 to the longitude (subject to fixed point scaling).
        /// </summary>
        public CartesianPoint ToCartesian()
        {
            LatLng ll = Normalize();

            int lat = ll.GetFixedLat();
            int lng = ll.GetFixedLng();

            return(new CartesianPoint(
                       lng + 180 * FixedLatLng.ScaleFactorInt,
                       lat + 90 * FixedLatLng.ScaleFactorInt
                       ));
        }
Esempio n. 2
0
		public FixedLatLng(LatLng ll)
		{
			_lat = ll.GetFixedLat();
			_lng = ll.GetFixedLng();
		}
Esempio n. 3
0
		public override LatLng CalculateMidpoint(LatLng other)
		{
			return new FixedLatLng((_lat + other.GetFixedLat())/2, (_lng + other.GetFixedLng())/2);
		}
Esempio n. 4
0
 public FixedLatLng(LatLng ll)
 {
     _lat = ll.GetFixedLat();
     _lng = ll.GetFixedLng();
 }
Esempio n. 5
0
 public override LatLng CalculateMidpoint(LatLng other)
 {
     return(new FixedLatLng((_lat + other.GetFixedLat()) / 2, (_lng + other.GetFixedLng()) / 2));
 }