Files
TowerOptoSifAndSpectral/othersoft/TemperatureControler/src/sunfunction/sunupanddown.h

23 lines
606 B
C

//
// Created by xin on 25-5-8.
//
#ifndef SUNUPANDDOWN_H
#define SUNUPANDDOWN_H
struct SunInfo {
double sunrise_h; // 日出时间(小时)
double sunrise_m; // 日出时间(分钟)
double sunset_h; // 日落时间(小时)
double sunset_m; // 日落时间(分钟)
bool hasSunlight; // 是否有阳光
};
SunInfo calculateSunriseSunset(int year, int month, int day, double latitude, double longitude);
void calculateSunriseSunset(int year, int month, int day, double latitude, double longitude,
double &sunrise, double &sunset, bool &hasSunlight);
#endif //SUNUPANDDOWN_H