/// <summary>Initializes a new instance of the Location class.</summary> /// <param name="latitude">The latitude of the coordinate.</param> /// <param name="longitude">The longitude of the coordinate.</param> /// <param name="altitude"> /// The altitude, specified in meters, of the coordinate. /// </param> /// <exception cref="ArgumentNullException"> /// latitude/longitude is null. /// </exception> public Location(Latitude latitude, Longitude longitude, double altitude) : this(latitude, longitude) { Altitude = altitude; }
private const int EarthRadius = 6366710; // The mean radius of the earth in meters. /// <summary>Initializes a new instance of the Location class.</summary> /// <param name="latitude">The latitude of the coordinate.</param> /// <param name="longitude">The longitude of the coordinate.</param> /// <exception cref="ArgumentNullException"> /// latitude or longitude is null. /// </exception> public Location(Latitude latitude, Longitude longitude) { Latitude = latitude ?? throw new ArgumentNullException(nameof(latitude)); Longitude = longitude ?? throw new ArgumentNullException(nameof(longitude)); }