Exemplo 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
                       ));
        }
Exemplo n.º 2
0
		public FixedLatLng(LatLng ll)
		{
			_lat = ll.GetFixedLat();
			_lng = ll.GetFixedLng();
		}
Exemplo n.º 3
0
		public override LatLng CalculateMidpoint(LatLng other)
		{
			return new FixedLatLng((_lat + other.GetFixedLat())/2, (_lng + other.GetFixedLng())/2);
		}
Exemplo n.º 4
0
 public FixedLatLng(LatLng ll)
 {
     _lat = ll.GetFixedLat();
     _lng = ll.GetFixedLng();
 }
Exemplo n.º 5
0
 public override LatLng CalculateMidpoint(LatLng other)
 {
     return(new FixedLatLng((_lat + other.GetFixedLat()) / 2, (_lng + other.GetFixedLng()) / 2));
 }