Loading...
Searching...
No Matches
moon.h
Go to the documentation of this file.
1
8#pragma once
9#include <time.h>
10#include <stdbool.h>
11#include <stdint.h>
12
17
18#define MOON_SYNODIC_SEC 2551443
19#define MOON_EPOCH_UTC 947182440
20
27int32_t moon_age_sec(time_t utc);
28
36int moon_glyph_index(time_t utc, int count);
37
45int moon_illumination_pct(time_t utc);
46
53const char *moon_phase_name(time_t utc);
54
64int moon_days_to_phase(time_t utc, bool to_full);
65
int moon_days_to_phase(time_t utc, bool to_full)
How many days until the next full or new moon, rounded to the nearest whole day.
Definition moon.c:48
const char * moon_phase_name(time_t utc)
Short name for the current phase (one of the eight main phases).
Definition moon.c:74
int moon_glyph_index(time_t utc, int count)
Picks one of count evenly spaced phase icons. It wraps back round at the end.
Definition moon.c:22
int moon_illumination_pct(time_t utc)
How lit up the moon looks, from 0 to 100. This is a rough straight-line guess, so it reads 0 at new m...
Definition moon.c:36
int32_t moon_age_sec(time_t utc)
How far into the current moon cycle we are, in seconds.
Definition moon.c:9