![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cGeospatial.h>
Public Member Functions | |
cGeoSunRise (void) | |
~cGeoSunRise (void) | |
HRESULT | Set (const cTimeDouble &t, const cGeoPos &p, TZ_TYPE nTimeZoneOffset) |
UNITTEST_FRIEND (cGeospatial) | |
![]() | |
const float | k_MinPos |
const double | k_MinPos |
const float | k_MaxSqrt |
const double | k_MaxSqrt |
const float | k_Epsilon |
const double | k_Epsilon |
const float | k_PI |
const double | k_PI |
const float | k_PI2 |
const double | k_PI2 |
const float | k_PIHalf |
const double | k_PIHalf |
const float | k_e |
const double | k_e |
const float | k_Log2e |
const double | k_Log2e |
const float | k_Log10e |
const double | k_Log10e |
const float | k_Ln2 |
const double | k_Ln2 |
const float | k_Ln10 |
const double | k_Ln10 |
Public Attributes | |
double | m_Declination |
radians More... | |
double | m_DayLength |
double hours. More... | |
double | m_SunAltAtNoon |
sun altitude at noon in radians. More... | |
double | m_tCivilAM |
AM time in the day. double hours. dawn. More... | |
double | m_tSunRise |
AM time in the day. double hours. More... | |
double | m_tSolarNoon |
double hours. true noon. More... | |
double | m_tSunSet |
PM time in the day. double hours. More... | |
double | m_tCivilPM |
PM time in the day. double hours. dusk. More... | |
Protected Member Functions | |
double | FNrange (double x) |
double | f0 (double lat, double declin) |
double | f1 (double lat, double declin) |
Additional Inherited Members | |
![]() | |
typedef cVecT2< double > | VEC_t |
![]() | |
static double GRAYCALL | GetDistMeters (const cGeoPos &p1, const cGeoPos &p2) |
static cGeoPos GRAYCALL | AddDistMeters (const cGeoPos &p1, double dx, double dy) |
![]() | |
static bool | isNumSigned () noexcept |
![]() | |
static const double | k_EarthRadiusMeters = 6371000.0 |
= 6371000.0; More... | |
static const double | k_SunDia = 0.53 |
= 0.53; // Sun radius degrees. (for daylight time) More... | |
static const double | k_AirRefr = 34.0 / 60.0 |
= 34.0 / 60.0; // atmospheric refraction degrees (for daylight time) More... | |
![]() | |
static const double | k_MinPos |
The min value that is positive and > 0. AKA FLT_MIN and DBL_MIN. More... | |
static const double | k_MaxSqrt |
The square root of <= k_Max. Not Max+1. More... | |
static const double | k_Epsilon |
smallest positive value such that (1.0+FLT_EPSILON != 1.0) More... | |
static const double | k_PI |
PI as a float or double. like M_PI, D3DX_PI. More... | |
static const double | k_PI2 |
PI times 2. M_PI. More... | |
static const double | k_PIHalf |
Half PI. More... | |
static const double | k_e |
M_E = 2.718281828... More... | |
static const double | k_Log2e |
M_LOG2E = log2(e) = 1/ln(2) More... | |
static const double | k_Log10e |
M_LOG10E = log10(e) = 1/ln(10) More... | |
static const double | k_Ln2 |
M_LN2 = ln(2) = 1/log2(e) More... | |
static const double | k_Ln10 |
M_LN10 = ln(10) = 1/log10(e) More... | |
![]() | |
static const double | k_Min |
Min value TYPE can represent. negative if signed type. NOT EPSILON (near zero). e.g. INT_MIN, -FLT_MAX. More... | |
static const double | k_Max |
Max positive value. Can equal this value. inclusive. AKA INT_MAX, FLT_MAX, DBL_MAX. More... | |
static const BYTE | k_TypeFlags |
CTYPE_FLAG_TYPE_ = float, signed, etc ? More... | |
Calculate sunrise/set at a position on Earth. http://williams.best.vwh.net/sunrise_sunset_example.htm http://www.esrl.noaa.gov/gmd/grad/solcalc/sunrise.html http://suncalc.net
GrayLib::cGeoSunRise::cGeoSunRise | ( | void | ) |
GrayLib::cGeoSunRise::~cGeoSunRise | ( | void | ) |
|
protected |
Calculating the hourangle Correction: different sign at S HS
|
protected |
Calculating the hourangle for twilight times Correction: different sign at S HS
|
protected |
the function below returns an angle in the range 0 to 2*k_PI
HRESULT GrayLib::cGeoSunRise::Set | ( | const cTimeDouble & | t, |
const cGeoPos & | p, | ||
TZ_TYPE | nTimeZoneOffset | ||
) |
Set the time and position on earth and figure out sunrise/sunset times for that Day/Place. Get the days to J2000 (UTC) http://en.wikipedia.org/wiki/Julian_year_%28astronomy%29 nTimeZoneOffsetHours = -5 = EST timezone offset. hours
GrayLib::cGeoSunRise::UNITTEST_FRIEND | ( | cGeospatial | ) |
double GrayLib::cGeoSunRise::m_DayLength |
double hours.
double GrayLib::cGeoSunRise::m_Declination |
radians
double GrayLib::cGeoSunRise::m_SunAltAtNoon |
sun altitude at noon in radians.
double GrayLib::cGeoSunRise::m_tCivilAM |
AM time in the day. double hours. dawn.
double GrayLib::cGeoSunRise::m_tCivilPM |
PM time in the day. double hours. dusk.
double GrayLib::cGeoSunRise::m_tSolarNoon |
double hours. true noon.
double GrayLib::cGeoSunRise::m_tSunRise |
AM time in the day. double hours.
double GrayLib::cGeoSunRise::m_tSunSet |
PM time in the day. double hours.