コード例 #1
0
ファイル: LatLng.cs プロジェクト: vivekshimpi01/lucene.net
        /// <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
                       ));
        }
コード例 #2
0
ファイル: FixedLatLng.cs プロジェクト: Rationalle/ravendb
		public FixedLatLng(LatLng ll)
		{
			_lat = ll.GetFixedLat();
			_lng = ll.GetFixedLng();
		}
コード例 #3
0
ファイル: FixedLatLng.cs プロジェクト: Rationalle/ravendb
		public override LatLng CalculateMidpoint(LatLng other)
		{
			return new FixedLatLng((_lat + other.GetFixedLat())/2, (_lng + other.GetFixedLng())/2);
		}
コード例 #4
0
 public FixedLatLng(LatLng ll)
 {
     _lat = ll.GetFixedLat();
     _lng = ll.GetFixedLng();
 }
コード例 #5
0
 public override LatLng CalculateMidpoint(LatLng other)
 {
     return(new FixedLatLng((_lat + other.GetFixedLat()) / 2, (_lng + other.GetFixedLng()) / 2));
 }