Exemple #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));
        }
Exemple #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));
        }
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- 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);
 }
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- 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);
 }