This commit is contained in:
hueso
2025-05-16 18:41:17 -03:00
parent 48399312be
commit 13863d32ca
3 changed files with 151 additions and 151 deletions

View File

@@ -1,8 +1,7 @@
#ifndef MoonRise_h
#define MoonRise_h
#include <time.h>
#include <stdint.h>
// Size of event search window in hours.
// Events further away from the search time than MR_WINDOW/2 will not be
// found. At higher latitudes the moon rise/set intervals become larger, so if
@@ -10,33 +9,33 @@
// windows will increase interpolation error. Useful values are probably from
// 12 - 48 but will depend upon your application.
#define MR_WINDOW 72 // Even integer
#define MR_WINDOW 48 // Even integer
typedef struct {
double RA; // Right ascension
double declination; // Declination
double distance; // Distance
double RA; // Right ascension
double declination; // Declination
double distance; // Distance
} skyCoordinates;
typedef struct {
time_t queryTime;
time_t riseTime;
time_t setTime;
float riseAz;
float setAz;
bool hasRise;
bool hasSet;
bool isVisible;
uint32_t queryTime;
uint32_t riseTime;
uint32_t setTime;
float riseAz;
float setAz;
bool hasRise;
bool hasSet;
bool isVisible;
} MoonRise;
MoonRise MoonRise_calculate(double latitude, double longitude, time_t t);
MoonRise MoonRise_calculate(double latitude, double longitude, uint32_t t);
// private:
void testMoonRiseSet(MoonRise *self, int i, double offsetDays, double latitude, double longitude,
skyCoordinates *mp);
void testMoonRiseSet(MoonRise *self, int i, double offsetDays, double latitude,
double longitude, skyCoordinates *mp);
skyCoordinates moon(double dayOffset);
double interpolate(double f0, double f1, double f2, double p);
double julianDate(time_t t);
double julianDate(uint32_t t);
double localSiderealTime(double offsetDays, double longitude);
#endif