コード例 #1
0
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 18JUN2009  James Shen                              Initial Creation
        ////////////////////////////////////////////////////////////////////////////

        /**
         * Returns the Distance, in meters, from this point to the given point.
         * By default, this Distance is calculated given the default equatorial
         * earth radius of 6378137 meters. The earth is approximated as a sphere,
         * hence the Distance could be off as much as 0.3%,
         * especially in the polar extremes.
         * @param other the other point.
         * @return the Distance, in meters.
         */
        public double DistanceFrom(GeoLatLng other)
        {
            GreateCircleCalculator cal = new GreateCircleCalculator(
                GreateCircleCalculator.EARTH_MODEL_WGS84,
                GreateCircleCalculator.UNIT_KM);

            return(cal.CalculateDistance(this, other));
        }
コード例 #2
0
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 18JUN2009  James Shen                              Initial Creation
        ////////////////////////////////////////////////////////////////////////////

        /**
         * Returns the Distance, in meters, from this point to the given point.
         * By default, this Distance is calculated given the default equatorial
         * earth radius of 6378137 meters. The earth is approximated as a sphere,
         * hence the Distance could be off as much as 0.3%,
         * especially in the polar extremes.
         * @param pt1 the first point.
         * @param pt2 the other point.
         * @return the Distance, in kilo meters.
         */
        public static double Distance(GeoLatLng pt1, GeoLatLng pt2)
        {
            GreateCircleCalculator cal = new GreateCircleCalculator(
                GreateCircleCalculator.EARTH_MODEL_WGS84,
                GreateCircleCalculator.UNIT_KM);

            return(cal.CalculateDistance(pt1, pt2));
        }
コード例 #3
0
ファイル: GeoLatLng.cs プロジェクト: 237rxd/maptiledownloader
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 18JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * Returns the Distance, in meters, from this point to the given point.
  * By default, this Distance is calculated given the default equatorial
  * earth radius of 6378137 meters. The earth is approximated as a sphere,
  * hence the Distance could be off as much as 0.3%,
  * especially in the polar extremes.
  * @param other the other point.
  * @return the Distance, in meters.
  */
 public double DistanceFrom(GeoLatLng other)
 {
     GreateCircleCalculator cal = new GreateCircleCalculator(
             GreateCircleCalculator.EARTH_MODEL_WGS84,
             GreateCircleCalculator.UNIT_KM);
     return cal.CalculateDistance(this, other);
 }
コード例 #4
0
ファイル: GeoLatLng.cs プロジェクト: 237rxd/maptiledownloader
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 18JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * Returns the Distance, in meters, from this point to the given point.
  * By default, this Distance is calculated given the default equatorial
  * earth radius of 6378137 meters. The earth is approximated as a sphere,
  * hence the Distance could be off as much as 0.3%,
  * especially in the polar extremes.
  * @param pt1 the first point.
  * @param pt2 the other point.
  * @return the Distance, in kilo meters.
  */
 public static double Distance(GeoLatLng pt1, GeoLatLng pt2)
 {
     GreateCircleCalculator cal = new GreateCircleCalculator(
             GreateCircleCalculator.EARTH_MODEL_WGS84,
             GreateCircleCalculator.UNIT_KM);
     return cal.CalculateDistance(pt1, pt2);
 }