Merge remote-tracking branch 'origin/master'

This commit is contained in:
2025-09-08 10:40:37 +08:00
3 changed files with 18 additions and 8 deletions
+7 -3
View File
@@ -4,6 +4,7 @@ import (
"b612.me/astro/tools"
"fmt"
"math"
"os"
"testing"
"time"
)
@@ -162,17 +163,20 @@ func TestJQDate(t *testing.T) {
return math.Floor(d) + 0.5
}
c := 0
var info string
for year := 1900; year <= 2600; year++ {
for pos := 0; pos < 360; pos += 15 {
n := newGetJQTime(year, pos)
o := GetJQTime(year, pos)
n := newGetJQTime(year, pos) + 8.0/24.000000
o := GetJQTime(year, pos) + 8.0/24.0000000
if trimDay(n) != trimDay(o) {
c++
fmt.Printf("\"%d%03d\":%.0f,", year, pos, trimDay(o)-trimDay(n))
fmt.Printf("\"%d%03d\"=>%v %v\n", year, pos, JDE2Date(trimDay(o)), JDE2Date(trimDay(n)))
info += fmt.Sprintf("\"%d%03d\"=>%.0f,", year, pos, trimDay(o)-trimDay(n))
}
}
}
fmt.Println(c)
os.WriteFile("test.txt", []byte(info), 0644)
}
func newGetJQTime(Year, Angle int) float64 { //节气时间