#include "timelib.h"
#include <stdio.h>
#include <math.h>
#include "astro.h"
Go to the source code of this file.
◆ acosd
Value:
Definition at line 51 of file astro.c.
◆ asind
Value:
Definition at line 50 of file astro.c.
◆ atan2d
Value:
atan2(float $y, float $x)
Definition at line 52 of file astro.c.
◆ atand
Value:
Definition at line 49 of file astro.c.
◆ cosd
Value:
Definition at line 46 of file astro.c.
◆ days_since_2000_Jan_0
#define days_since_2000_Jan_0 |
( |
| y, |
|
|
| m, |
|
|
| d ) |
Value: (367L*(y)-((7*((y)+(((m)+9)/12)))/4)+((275*(m))/9)+(d)-730530L)
Definition at line 33 of file astro.c.
◆ DEGRAD
◆ INV360
◆ PI
#define PI 3.1415926535897932384 |
◆ RADEG
◆ sind
Value:
Definition at line 45 of file astro.c.
◆ tand
Value:
Definition at line 47 of file astro.c.
◆ timelib_astro_rise_set_altitude()
Note: timestamp = unixtimestamp (NEEDS to be 00:00:00 UT) Eastern longitude positive, Western longitude negative Northern latitude positive, Southern latitude negative The longitude value IS critical in this function! altit = the altitude which the Sun should cross Set to -35/60 degrees for rise/set, -6 degrees for civil, -12 degrees for nautical and -18 degrees for astronomical twilight. upper_limb: non-zero -> upper limb, zero -> center Set to non-zero (e.g. 1) when computing rise/set times, and to zero when computing start/end of twilight. *rise = where to store the rise time *set = where to store the set time Both times are relative to the specified altitude, and thus this function can be used to compute various twilight times, as well as rise/set times Return value: 0 = sun rises/sets this day, times stored at *trise and *tset. +1 = sun above the specified "horizon" 24 hours. *trise set to time when the sun is at south, minus 12 hours while *tset is set to the south time plus 12 hours. "Day" length = 24 hours -1 = sun is below the specified "horizon" 24 hours "Day" length = 0 hours, *trise and *tset are both set to the time when the sun is at south.
Definition at line 212 of file astro.c.
◆ timelib_ts_to_j2000()
◆ timelib_ts_to_julianday()
Converts the Unix Epoch time stamp 'ts' to a Julian Day
The value returned is the number of whole days since -4714-11-24T12:00:00 UTC (in the proleptic Gregorian calendar): https://en.wikipedia.org/wiki/Julian_day
Definition at line 299 of file astro.c.