Rhino C++ API  8.14
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ON_SunEngine Class Reference

Class ON_SunEngine is a sun astronomical calculation engine. More...

#include <opennurbs_sun.h>

Public Types

enum  Accuracy { Accuracy::Minimum, Accuracy::Maximum }
 

Public Member Functions

 ON_SunEngine (Accuracy a)
 
 ON_SunEngine (const ON_SunEngine &)
 
virtual ~ON_SunEngine ()
 
virtual double Altitude (void) const
 Returns The altitude of the sun in degrees. More...
 
virtual double Azimuth (void) const
 Returns The azimuth of the sun in degrees. More...
 
virtual int DaylightSavingMinutes (void) const
 Returns The daylight saving of the observer in minutes. More...
 
virtual double JulianDay (void) const
 Returns The Julian Day corresponding to Universal Time (UT ~ GMT). More...
 
virtual double Latitude (void) const
 Return the latitude of the observer in degrees. More...
 
virtual void LocalDateTime (int &year, int &month, int &day, double &hours) const
 
virtual double LocalJulianDay (void) const
 Returns The Julian Day corresponding to local time. More...
 
virtual double Longitude (void) const
 Return the longitude of the observer in degrees. More...
 
bool operator!= (const ON_SunEngine &e)
 
const ON_SunEngineoperator= (const ON_SunEngine &)
 
bool operator== (const ON_SunEngine &e)
 
virtual bool SetDaylightSavingMinutes (int iMinutes)
 
virtual bool SetLatitude (double dLat)
 
virtual bool SetLocalDateTime (int iYear, int iMonth, int iDay, double dHours)
 
virtual bool SetLocalJulianDay (double dLocalJulianDay)
 
virtual bool SetLongitude (double dLong)
 
virtual bool SetTimeZoneHours (double dHours)
 
virtual double TimeZoneHours (void) const
 Returns The time zone of the observer in hours. More...
 

Static Public Member Functions

static void ConvertHorizonCoordsToSolarVector (double dAzimuth, double dAltitude, double *dVector)
 Helper function; converts azimuth and altitude to unit vector. More...
 
static void ConvertSolarVectorToHorizonCoords (const double *dVector, double &dAzimuth, double &dAltitude)
 Helper function; converts unit vector to azimuth and altitude. More...
 
static int DaysInMonth (int month, int year)
 Helper function; returns the number of days in a month for a specific year. More...
 
static void GetCurrentLocalDateTime (int &y, int &m, int &d, double &h)
 Helper function; gets the current local date and time. More...
 
static void GetDefaultLocalDateTime (int &y, int &m, int &d, double &h)
 

Detailed Description

Class ON_SunEngine is a sun astronomical calculation engine.

Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete openNURBS copyright information see http://www.opennurbs.org.

Member Enumeration Documentation

◆ Accuracy

Enumerator
Minimum 

Suitable for doing many calculations when you just need rough results quickly.

Maximum 

Suitable for generating accurate tables of sun positions (e.g., an ephemeris).

Constructor & Destructor Documentation

◆ ON_SunEngine() [1/2]

ON_SunEngine::ON_SunEngine ( Accuracy  a)

◆ ON_SunEngine() [2/2]

ON_SunEngine::ON_SunEngine ( const ON_SunEngine )

◆ ~ON_SunEngine()

virtual ON_SunEngine::~ON_SunEngine ( )
virtual

Member Function Documentation

◆ Altitude()

virtual double ON_SunEngine::Altitude ( void  ) const
virtual

Returns The altitude of the sun in degrees.

◆ Azimuth()

virtual double ON_SunEngine::Azimuth ( void  ) const
virtual

Returns The azimuth of the sun in degrees.

◆ ConvertHorizonCoordsToSolarVector()

static void ON_SunEngine::ConvertHorizonCoordsToSolarVector ( double  dAzimuth,
double  dAltitude,
double *  dVector 
)
static

Helper function; converts azimuth and altitude to unit vector.

◆ ConvertSolarVectorToHorizonCoords()

static void ON_SunEngine::ConvertSolarVectorToHorizonCoords ( const double *  dVector,
double &  dAzimuth,
double &  dAltitude 
)
static

Helper function; converts unit vector to azimuth and altitude.

◆ DaylightSavingMinutes()

virtual int ON_SunEngine::DaylightSavingMinutes ( void  ) const
virtual

Returns The daylight saving of the observer in minutes.

◆ DaysInMonth()

static int ON_SunEngine::DaysInMonth ( int  month,
int  year 
)
static

Helper function; returns the number of days in a month for a specific year.

◆ GetCurrentLocalDateTime()

static void ON_SunEngine::GetCurrentLocalDateTime ( int &  y,
int &  m,
int &  d,
double &  h 
)
static

Helper function; gets the current local date and time.

◆ GetDefaultLocalDateTime()

static void ON_SunEngine::GetDefaultLocalDateTime ( int &  y,
int &  m,
int &  d,
double &  h 
)
static

Helper function; gets the default local date and time. This is March 21st of the current year at 12:00 noon local time.

◆ JulianDay()

virtual double ON_SunEngine::JulianDay ( void  ) const
virtual

Returns The Julian Day corresponding to Universal Time (UT ~ GMT).

◆ Latitude()

virtual double ON_SunEngine::Latitude ( void  ) const
virtual

Return the latitude of the observer in degrees.

◆ LocalDateTime()

virtual void ON_SunEngine::LocalDateTime ( int &  year,
int &  month,
int &  day,
double &  hours 
) const
virtual

Gets the local date and time of the observer. Param year accepts the year in the range 1800 to 2199. Param month accepts the month in the range 1 to 12. Param day accepts the day in the range 1 to 31. Param hours accepts the hour in the range 0 to 24.

◆ LocalJulianDay()

virtual double ON_SunEngine::LocalJulianDay ( void  ) const
virtual

Returns The Julian Day corresponding to local time.

◆ Longitude()

virtual double ON_SunEngine::Longitude ( void  ) const
virtual

Return the longitude of the observer in degrees.

◆ operator!=()

bool ON_SunEngine::operator!= ( const ON_SunEngine e)

◆ operator=()

const ON_SunEngine& ON_SunEngine::operator= ( const ON_SunEngine )

◆ operator==()

bool ON_SunEngine::operator== ( const ON_SunEngine e)

◆ SetDaylightSavingMinutes()

virtual bool ON_SunEngine::SetDaylightSavingMinutes ( int  iMinutes)
virtual

Set the daylight saving of the observer in minutes. Must be in the range 0 to 120. Returns true if minutes is valid, else false.

◆ SetLatitude()

virtual bool ON_SunEngine::SetLatitude ( double  dLat)
virtual

Set the latitude of the observer in degrees. Must be in the range -90 to +90. This value is used by the calculation of the sun's azimuth and altitude. Returns true if latitude is valid, else false.

◆ SetLocalDateTime()

virtual bool ON_SunEngine::SetLocalDateTime ( int  iYear,
int  iMonth,
int  iDay,
double  dHours 
)
virtual

Set the local date and time of the observer. The date must lie between 1800 and 2199 inclusive. The time is supplied as decimal hours which must be in the range 0 to 24. Returns true if date and time are valid, else false.

◆ SetLocalJulianDay()

virtual bool ON_SunEngine::SetLocalJulianDay ( double  dLocalJulianDay)
virtual

Set the local Julian Day of the observer. Optional alternative to calling SetLocalDateTime(). Returns true if Julian Day is valid, else false.

◆ SetLongitude()

virtual bool ON_SunEngine::SetLongitude ( double  dLong)
virtual

Set the longitude of the observer in degrees. Must be in the range -180 to +180. This value is used by the calculation of the sun's azimuth and altitude. Returns true if longitude is valid, else false.

◆ SetTimeZoneHours()

virtual bool ON_SunEngine::SetTimeZoneHours ( double  dHours)
virtual

Set the time zone of the observer in hours. Must be in the range -12 to +13. Returns true if hours is valid, else false.

◆ TimeZoneHours()

virtual double ON_SunEngine::TimeZoneHours ( void  ) const
virtual

Returns The time zone of the observer in hours.