A class that contains location information such as latitude and longitude required for astronomical calculations. The elevation field is not used by most calculation engines and would be ignored if set. Check the documentation for specific implementations of the
to see if elevation is calculated as part o the algorithm. More...
Public Member Functions | |
GeoLocation (double latitude, double longitude, ITimeZone timeZone) | |
GeoLocation (string name, double latitude, double longitude, ITimeZone timeZone) | |
GeoLocation (string name, double latitude, double longitude, double elevation, ITimeZone timeZone) | |
virtual object | Clone () |
Creates a new object that is a copy of the current instance. | |
virtual void | SetLatitude (int degrees, int minutes, double seconds, string direction) |
virtual void | SetLongitude (int degrees, int minutes, double seconds, string direction) |
value> Returns the location name. | |
virtual long | GetLocalMeanTimeOffset (DateTime date) |
A method that will return the location's local mean time offset in milliseconds from local standard time. The globe is split into 360°, with 15° per hour of the day. For a local that is at a longitude that is evenly divisible by 15 (longitude % 15 == 0), at solar noon (with adjustment for the equation of time) the sun should be directly overhead, so a user who is 1° west of this will have noon at 4 minutes after standard time noon, and conversely, a user who is 1° east of the 15° longitude will have noon at 11:56 AM. | |
virtual double | GetGeodesicInitialBearing (GeoLocation location) |
virtual double | GetGeodesicFinalBearing (GeoLocation location) |
virtual double | GetGeodesicDistance (GeoLocation location) |
virtual double | GetRhumbLineBearing (GeoLocation location) |
virtual double | GetRhumbLineDistance (GeoLocation location) |
virtual string | ToXml () |
override bool | Equals (object obj) |
Determines whether the specified System.Object is equal to this instance. | |
override int | GetHashCode () |
Returns a hash code for this instance. | |
override string | ToString () |
Returns a System.String that represents this instance. | |
Properties | |
virtual double | Elevation [get, set] |
virtual double | Latitude [get, set] |
virtual double | Longitude [get, set] |
virtual string | LocationName [get, set] |
value> Returns the timeZone. | |
virtual ITimeZone | TimeZone [get, set] |
A class that contains location information such as latitude and longitude required for astronomical calculations. The elevation field is not used by most calculation engines and would be ignored if set. Check the documentation for specific implementations of the
to see if elevation is calculated as part o the algorithm.
<author>Eliyahu Hershfeld</author>
Zmanim.Utilities.GeoLocation.GeoLocation | ( | double | latitude, | |
double | longitude, | |||
ITimeZone | timeZone | |||
) |
summary> GeoLocation constructor with parameters for all required fields. /summary> param name = "name"> The location name for display use such as "Lakewood, NJ"
param name = "latitude"> the latitude in a double format such as 40.095965 for Lakewood, NJ
Note: For latitudes south of the equator, a negative value should be used.
param name = "longitude"> double the longitude in a double format such as -74.222130 for Lakewood, NJ.
Note: For longitudes east of the Prime Meridian (Greenwich), a negative value should be used.
param name = "timeZone"> the TimeZone
for the location.
Zmanim.Utilities.GeoLocation.GeoLocation | ( | string | name, | |
double | latitude, | |||
double | longitude, | |||
ITimeZone | timeZone | |||
) |
summary> GeoLocation constructor with parameters for all required fields. /summary> param name = "name"> The location name for display use such as "Lakewood, NJ"
param name = "latitude"> the latitude in a double format such as 40.095965 for Lakewood, NJ
Note: For latitudes south of the equator, a negative value should be used.
param name = "longitude"> double the longitude in a double format such as -74.222130 for Lakewood, NJ.
Note: For longitudes east of the Prime Meridian (Greenwich), a negative value should be used.
param name = "elevation"> the elevation above sea level in Meters. Elevation is not used in most algorithms used for calculating sunrise and set.
param name = "timeZone"> the TimeZone
for the location.
Zmanim.Utilities.GeoLocation.GeoLocation | ( | string | name, | |
double | latitude, | |||
double | longitude, | |||
double | elevation, | |||
ITimeZone | timeZone | |||
) |
summary> Default GeoLocation constructor will set location to the Prime Meridian at Greenwich, England and a TimeZone of GMT. The longitude will be set to 0 and the latitude will be 51.4772 to match the location of the Royal Observatory, Greenwich . No daylight savings time will be used. /summary>
virtual object Zmanim.Utilities.GeoLocation.Clone | ( | ) | [virtual] |
Creates a new object that is a copy of the current instance.
summary> Method to get the elevation in Meters. /summary> value> Returns the elevation in Meters.
override bool Zmanim.Utilities.GeoLocation.Equals | ( | object | obj | ) |
Determines whether the specified System.Object is equal to this instance.
obj | The System.Object to compare with this instance. |
true
if the specified System.Object is equal to this instance; otherwise, false
. T:System.NullReferenceException | The obj parameter is null. |
virtual double Zmanim.Utilities.GeoLocation.GetGeodesicDistance | ( | GeoLocation | location | ) | [virtual] |
summary> Calculate geodesic distance in Meters between this Object and a second Object passed to this method using Thaddeus Vincenty's inverse formula See T Vincenty, "<a href = "http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf">Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of nested equations", Survey Review, vol XXII no 176, 1975 /summary> param name = "location"> the destination location
param name = "formula"> This formula calculates initial bearing (
), final bearing () and distance ().
Implements Zmanim.Utilities.IGeoLocation.
virtual double Zmanim.Utilities.GeoLocation.GetGeodesicFinalBearing | ( | GeoLocation | location | ) | [virtual] |
summary> Calculate geodesic distance in Meters between this Object and a second Object passed to this method using Thaddeus Vincenty's inverse formula See T Vincenty, "<a href = "http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf">Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of nested equations", Survey Review, vol XXII no 176, 1975 /summary> param name = "location"> the destination location
Implements Zmanim.Utilities.IGeoLocation.
virtual double Zmanim.Utilities.GeoLocation.GetGeodesicInitialBearing | ( | GeoLocation | location | ) | [virtual] |
summary> Calculate the final geodesic bearing between this Object and a second Object passed to this method using Thaddeus Vincenty's inverse formula See T Vincenty, "<a href = "http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf">Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of nested equations", Survey Review, vol XXII no 176, 1975 /summary> param name = "location"> the destination location
Implements Zmanim.Utilities.IGeoLocation.
override int Zmanim.Utilities.GeoLocation.GetHashCode | ( | ) |
Returns a hash code for this instance.
virtual long Zmanim.Utilities.GeoLocation.GetLocalMeanTimeOffset | ( | DateTime | date | ) | [virtual] |
A method that will return the location's local mean time offset in milliseconds from local standard time. The globe is split into 360°, with 15° per hour of the day. For a local that is at a longitude that is evenly divisible by 15 (longitude % 15 == 0), at solar noon (with adjustment for the equation of time) the sun should be directly overhead, so a user who is 1° west of this will have noon at 4 minutes after standard time noon, and conversely, a user who is 1° east of the 15° longitude will have noon at 11:56 AM.
date | The date used to get the UtcOffset. |
summary> Calculate the initial geodesic bearing between this Object and a second Object passed to this method using Thaddeus Vincenty's inverse formula See T Vincenty, "<a href = "http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf">Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of nested equations", Survey Review, vol XXII no 176, 1975 /summary> param name = "location"> the destination location
Implements Zmanim.Utilities.IGeoLocation.
virtual double Zmanim.Utilities.GeoLocation.GetRhumbLineBearing | ( | GeoLocation | location | ) | [virtual] |
summary> Returns the rhumb line distance from the current location to the GeoLocation passed in. /summary> param name = "location"> the destination location
returns> the distance in Meters
Implements Zmanim.Utilities.IGeoLocation.
virtual double Zmanim.Utilities.GeoLocation.GetRhumbLineDistance | ( | GeoLocation | location | ) | [virtual] |
summary> A method that returns an XML formatted String
representing the serialized Object
. Very similar to the toString method but the return value is in an xml format. The format currently used (subject to change) is:
<GeoLocation> <LocationName>Lakewood, NJ</LocationName> <Latitude>40.0828&deg</Latitude> <Longitude>-74.2094&deg</Longitude> <Elevation>0 Meters</Elevation> <TimezoneName>America/New_York</TimezoneName> <TimeZoneDisplayName>Eastern Standard Time</TimeZoneDisplayName> <TimezoneGMTOffset>-5</TimezoneGMTOffset> <TimezoneDSTOffset>1</TimezoneDSTOffset> </GeoLocation>
/summary> returns> The XML formatted
String
.
Implements Zmanim.Utilities.IGeoLocation.
virtual void Zmanim.Utilities.GeoLocation.SetLatitude | ( | int | degrees, | |
int | minutes, | |||
double | seconds, | |||
string | direction | |||
) | [virtual] |
summary> Method to set the longitude in a double format. /summary> value> The degrees of longitude to set in a double format between -180° and 180°. An IllegalArgumentException will be thrown if the value exceeds the limit. For example -74.2094 would be used for Lakewood, NJ. Note: for longitudes east of the <a href = "http://en.wikipedia.org/wiki/Prime_Meridian">Prime Meridian</a> (Greenwich) a negative value should be used.
override string Zmanim.Utilities.GeoLocation.ToString | ( | ) |
Returns a System.String that represents this instance.
virtual double Zmanim.Utilities.GeoLocation.Elevation [get, set] |
summary> Method to set the latitude. /summary> value> The degrees of latitude to set. The values should be between -90° and 90°. An IllegalArgumentException will be thrown if the value exceeds the limit. For example 40.095965 would be used for Lakewood, NJ. <b>Note: </b> For latitudes south of the equator, a negative value should be used.
Implements Zmanim.Utilities.IGeoLocation.
virtual double Zmanim.Utilities.GeoLocation.Latitude [get, set] |
summary> Method to set the latitude in degrees, minutes and seconds. /summary> param name = "degrees"> The degrees of latitude to set between -90 and 90. An IllegalArgumentException will be thrown if the value exceeds the limit. For example 40 would be used for Lakewood, NJ.
param name = "minutes"> minutes of arc
param name = "seconds"> seconds of arc
param name = "direction"> N for north and S for south. An IllegalArgumentException will be thrown if the value is not S or N.
Implements Zmanim.Utilities.IGeoLocation.
virtual double Zmanim.Utilities.GeoLocation.Longitude [get, set] |
summary> Method to set the longitude in degrees, minutes and seconds. /summary> param name = "degrees"> The degrees of longitude to set between -180 and 180. An IllegalArgumentException will be thrown if the value exceeds the limit. For example -74 would be used for Lakewood, NJ. Note: for longitudes east of the Prime Meridian (Greenwich) a negative value should be used.
param name = "minutes"> minutes of arc
param name = "seconds"> seconds of arc
param name = "direction"> E for east of the Prime Meridian or W for west of it. An IllegalArgumentException will be thrown if the value is not E or W.
Implements Zmanim.Utilities.IGeoLocation.