Zmanim.Utilities.GeoLocation Class Reference

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

See also:
AstronomicalCalculator

to see if elevation is calculated as part o the algorithm. More...

Inheritance diagram for Zmanim.Utilities.GeoLocation:
Zmanim.Utilities.IGeoLocation

List of all members.

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]

Detailed Description

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

See also:
AstronomicalCalculator

to see if elevation is calculated as part o the algorithm.

<author>Eliyahu Hershfeld</author>


Constructor & Destructor Documentation

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>


Member Function Documentation

virtual object Zmanim.Utilities.GeoLocation.Clone (  )  [virtual]

Creates a new object that is a copy of the current instance.

Returns:
A new object that is a copy of this 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.

Parameters:
obj The System.Object to compare with this instance.
Returns:
true if the specified System.Object is equal to this instance; otherwise, false.
Exceptions:
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 (

See also:
INITIAL_BEARING, FINAL_BEARING, DISTANCE

), 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.

Returns:
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
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.

Parameters:
date The date used to get the UtcOffset.
Returns:
the offset in milliseconds not accounting for Daylight saving time. A positive value will be returned East of the timezone line, and a negative value West of it.

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:

               &lt;GeoLocation&gt;
               &lt;LocationName&gt;Lakewood, NJ&lt;/LocationName&gt;
               &lt;Latitude&gt;40.0828&amp;deg&lt;/Latitude&gt;
               &lt;Longitude&gt;-74.2094&amp;deg&lt;/Longitude&gt;
               &lt;Elevation&gt;0 Meters&lt;/Elevation&gt;
               &lt;TimezoneName&gt;America/New_York&lt;/TimezoneName&gt;
               &lt;TimeZoneDisplayName&gt;Eastern Standard Time&lt;/TimeZoneDisplayName&gt;
               &lt;TimezoneGMTOffset&gt;-5&lt;/TimezoneGMTOffset&gt;
               &lt;TimezoneDSTOffset&gt;1&lt;/TimezoneDSTOffset&gt;
               &lt;/GeoLocation&gt;

/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&quot;&gt;Prime Meridian</a> (Greenwich) a negative value should be used.

override string Zmanim.Utilities.GeoLocation.ToString (  ) 

Returns a System.String that represents this instance.

Returns:
A System.String that represents this instance.

Property Documentation

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.


The documentation for this class was generated from the following file:
Generated on Mon May 31 12:33:43 2010 for Zmanim Project by  doxygen 1.6.3