add moonrise/moonset face
Some checks failed
Build / build (sensorwatch_blue, classic) (push) Has been cancelled
Build / build (sensorwatch_blue, custom) (push) Has been cancelled
Build / build (sensorwatch_green, classic) (push) Has been cancelled
Build / build (sensorwatch_green, custom) (push) Has been cancelled
Build / build (sensorwatch_pro, classic) (push) Has been cancelled
Build / build (sensorwatch_pro, custom) (push) Has been cancelled
Build / build (sensorwatch_red, classic) (push) Has been cancelled
Build / build (sensorwatch_red, custom) (push) Has been cancelled
Build / build-simulator (sensorwatch_blue, classic) (push) Has been cancelled
Build / build-simulator (sensorwatch_blue, custom) (push) Has been cancelled
Build / build-simulator (sensorwatch_green, classic) (push) Has been cancelled
Build / build-simulator (sensorwatch_green, custom) (push) Has been cancelled
Build / build-simulator (sensorwatch_pro, classic) (push) Has been cancelled
Build / build-simulator (sensorwatch_pro, custom) (push) Has been cancelled
Build / build-simulator (sensorwatch_red, classic) (push) Has been cancelled
Build / build-simulator (sensorwatch_red, custom) (push) Has been cancelled
Some checks failed
Build / build (sensorwatch_blue, classic) (push) Has been cancelled
Build / build (sensorwatch_blue, custom) (push) Has been cancelled
Build / build (sensorwatch_green, classic) (push) Has been cancelled
Build / build (sensorwatch_green, custom) (push) Has been cancelled
Build / build (sensorwatch_pro, classic) (push) Has been cancelled
Build / build (sensorwatch_pro, custom) (push) Has been cancelled
Build / build (sensorwatch_red, classic) (push) Has been cancelled
Build / build (sensorwatch_red, custom) (push) Has been cancelled
Build / build-simulator (sensorwatch_blue, classic) (push) Has been cancelled
Build / build-simulator (sensorwatch_blue, custom) (push) Has been cancelled
Build / build-simulator (sensorwatch_green, classic) (push) Has been cancelled
Build / build-simulator (sensorwatch_green, custom) (push) Has been cancelled
Build / build-simulator (sensorwatch_pro, classic) (push) Has been cancelled
Build / build-simulator (sensorwatch_pro, custom) (push) Has been cancelled
Build / build-simulator (sensorwatch_red, classic) (push) Has been cancelled
Build / build-simulator (sensorwatch_red, custom) (push) Has been cancelled
This commit is contained in:
43
lib/moonrise/moonrise.h
Normal file
43
lib/moonrise/moonrise.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#ifndef MoonRise_h
|
||||
#define MoonRise_h
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.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
|
||||
// you want to find the nearest events this will need to increase. Larger
|
||||
// windows will increase interpolation error. Useful values are probably from
|
||||
// 12 - 48 but will depend upon your application.
|
||||
|
||||
#define MR_WINDOW 48 // Even integer
|
||||
|
||||
typedef struct {
|
||||
double RA; // Right ascension
|
||||
double declination; // Declination
|
||||
double distance; // Distance
|
||||
} skyCoordinates;
|
||||
|
||||
typedef struct {
|
||||
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, uint32_t t);
|
||||
|
||||
// private:
|
||||
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(uint32_t t);
|
||||
double localSiderealTime(double offsetDays, double longitude);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user