From b1be91bc7562571bcb156d20ec3f9c8b69340722 Mon Sep 17 00:00:00 2001 From: We-unite <3205135446@qq.com> Date: Fri, 8 Mar 2024 22:53:11 +0800 Subject: Calculate sunrise and sunset, showing time and azimuth Add sun trace table, and put all data into file --- src/calendar.h | 42 ++++++------------------------------------ 1 file changed, 6 insertions(+), 36 deletions(-) (limited to 'src/calendar.h') diff --git a/src/calendar.h b/src/calendar.h index 248026f..87ca413 100644 --- a/src/calendar.h +++ b/src/calendar.h @@ -10,43 +10,13 @@ using namespace std; // 哈尔滨南岗地方经纬度 -#define LONGITUDE 126.533 * M_PI / 180 -#define LATITUDE 45.800 * M_PI / 180 - -extern double delta; -extern char jieqi[25][10]; +#define M_PI 3.14159265358979323846 +#define LONGITUDE 126.66854 * M_PI / 180 +#define LATITUDE 45.75996 * M_PI / 180 typedef struct tm Date; -struct point { - int year, mon, day, hour, min, sec; - bool isShuo, isJieqi, isZhongqi; - int JieqiIndex, MonthIndex; - bool RunYue; - double time; - point *next; - - point(int year, int mon, int day, int hour, int min, int sec, bool isShuo, - bool isJieqi, bool isZhongqi, int JieqiIndex, int MonthIndex, - bool RunYue, double time) { - this->year = year; - this->mon = mon; - this->day = day; - this->hour = hour; - this->min = min; - this->sec = sec; - this->isShuo = isShuo; - this->isJieqi = isJieqi; - this->isZhongqi = isZhongqi; - this->JieqiIndex = JieqiIndex; - this->MonthIndex = MonthIndex; - this->RunYue = RunYue; - this->time = time; - this->next = NULL; - } -}; -void radToDMS(const char *message, int lowerBound, int upperBound, - double radians); +string radToDMS(int lowerBound, int upperBound, double radians); class Julian { private: @@ -96,8 +66,6 @@ class parameter { public: pair sun_longitude(double t); - double moon_longitude(double t); - double get_epsilon(double T); // 计算时角,返回弧度制 @@ -107,4 +75,6 @@ class parameter { extern Julian julian; extern parameter p; +extern double epsilon; + #endif \ No newline at end of file -- cgit v1.2.3-70-g09d2