v2.7.2.1
- Exposes solar noon property allowing users to obtain solar noon data points.
- Adds ability to get time of day from a provided sun altitude and position.
- Adds ability to get MGRS square identifier corner points for specified MGRS coordinate.
- Parser/XML improvements.
Solar Noon Example
var c = new Coordinate(45.2,-112.4);
c.CelestialInfo.SolarNoon;
Getting Time of Day from Position, Date and Solar Altitude
//lat, long, date, altitude in degrees, UTC offset (if desired).
AltitudeEvents aev = Celestial.Get_Time_at_Solar_Altitude(47.4, -122.6, new DateTime(2020,8,11), 41.6, -7);
//Altitude point crossed time during solar rising
if(aev.Rising.HasValue)
{
aev.Rising; //8/11/2020 10:22:12 AM
}
//Altitude point crossed time during solar setting
if(aev.Setting.HasValue)
{
aev.Setting; //8/11/2020 4:11:33 PM
Obstaining MGRS 100km Square Points/Boundaries
//Create MGRS Coordinate at a Grid Zone Junction Point (partial square)
MilitaryGridReferenceSystem mgrs = new MilitaryGridReferenceSystem("N", 21, "SA", 66037, 61982);
//Set EagerLoad to MGRS only for efficiency
//Only applicable if pulling Lat/Long Coordinate values from box corners
EagerLoad el = new EagerLoad(EagerLoadType.UTM_MGRS);
var gb = mgrs.Get_Box_Boundaries(el);
//Check if box is Valid first (if not corners will be null)
if(!gb.IsBoxValid){return;}
//Get Bottom Left MGRS Object
gb.Bottom_Left_MGRS_Point; //21N SA 66022 00000
//Get Bottom Left Corodinate Object
//Will throw exception if MGRS is not valid.
gb.Bottom_Left_Coordinate_Point; //N 0º 0' 0" W 59º 59' 59.982"