1

I have a question regarding using suncalc.js or other JavaScript solution for Sun-related calculations. Calculate the date & time given the position of the sun (Azimuth & elevation) and latitude and longitude — this preexisting thread did not provide a viable answer. In Chinese and Japanese culture there are 24 Solar Terms, the dates of which are calculated taking into account the ecliptic longitude by two methods — píngqì (平気) based on the mean motion of the Sun dividing the tropical year evenly into 24 periods, and dìngqì (定気) based on the position of the Sun on the ecliptic. I'd like to have a script that calculates the exact local time (MM/DD hh:mm) for the given year at the location given by lat/lon GPS coordinates of main 8 Solar Terms, each of which take place at given ecliptic longitude, in both methods:

315° = 1 Lichun,
0° = 2 Chunfen (Spring Equinox),
45° = 3 Lixia,
90° = 4 Xiazhi (Summer Solstice),
135° = 5 Liqiu,
180° = 6 Qiufen (Autumn Equinox),
225° = 7 Lidong,
270° = 8 Dongzhi (Winter Solstice).

For instance:

getSolarTerm(2022,4,"dingqi","35.6819,139.7534")

i.e. Xiazhi (Summer Solstice) of 2022, in case of Tokyo, Japan should return "06/21 18:14", and

getSolarTerm(2022,4,"pingqi","35.6819,139.7534")

i.e. Xiazhi (Summer Solstice) of 2022, in case of Tokyo, Japan should return "06/22 04:55".

ugisu
  • 21
  • 4
  • You really need to provide the algorithm to preform the calculation, otherwise this is a question for some other forum. The calculations for the Earth's position are not simple, see [*Astronomical Calculations: Solar Coordinates*](https://squarewidget.com/solar-coordinates/). – RobG Oct 18 '21 at 23:28

0 Answers0