Ejemplo n.º 1
0
 /// <summary>
 /// Convert a distance into latitude degrees.
 /// </summary>
 /// <returns>Latitude degrees</returns>
 /// <param name="distance">Distance</param>
 static double DistanceToLatitudeDegrees(Distance distance)
 {
     return(distance.Kilometers / EarthCircumferenceKm * 360);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Convert a distances into longitude degrees
        /// </summary>
        /// <returns>Longitude degrees</returns>
        /// <param name="position">Position for latitude to use for circumference</param>
        /// <param name="distance">Distance</param>
        static double DistanceToLongitudeDegrees(Position position, Distance distance)
        {
            double latCircumference = LatitudeCircumferenceKm(position);

            return(distance.Kilometers / latCircumference * 360);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a new MapSpan from center and radius
 /// </summary>
 /// <returns>New MapSpan</returns>
 /// <param name="center">Center for new MapSpan</param>
 /// <param name="radius">Radius for new MapSpan</param>
 public static MapSpan FromCenterAndRadius(Position center, Distance radius)
 {
     return(new MapSpan(center, 2 * DistanceToLatitudeDegrees(radius), 2 * DistanceToLongitudeDegrees(center, radius)));
 }