Click or drag to resize

Celestial Constructor (Double, Double, DateTime)

Creates a Celestial object based on a location and specified date.

Namespace:  CoordinateSharp
Assembly:  CoordinateSharp (in CoordinateSharp.dll) Version: 2.12.1.1
Syntax
C#
public Celestial(
	double lat,
	double longi,
	DateTime geoDate
)

Parameters

lat
Type: SystemDouble
Latitude
longi
Type: SystemDouble
Longitude
geoDate
Type: SystemDateTime
DateTime (UTC)
Remarks
Celestial information is normally populated within the Coordinate classes CelestialInfo property. However, you may choose to work directly within the Celestial class.
Examples
The following example demonstrates how to get the sunset time at Seattle on 19-Mar-2019 directly from a Celestial object.
//Create a Celestial object the calculates from Seattle's signed lat/long on
//19-Mar-2019 (UTC) Date
Celestial cel = new Celestial(47.60357, -122.32945, new DateTime(2019, 3, 19));

//Check if a sunset will occur on the specified day.
if(cel.SunSet.HasValue)
{
    Console.WriteLine(cel.SunSet.Value); //3/19/2019 2:19:31 AM
}
See Also