feat: 新增月掩与日月食地理绘图并提升观测计算精度
- 新增月掩恒星和行星:支持搜索、掩甚点、全球掩带及固定地点轨迹计算 - 支持恒星星表坐标转换、有限盘面行星接触事件和月掩 SVG 输出 - 新增日月食及月掩全球投影图、时间标记和 GeoJSON 地理数据接口 - 扩展日食中心线、南北界及偏食足迹采样,支持极区投影 - 修正站心时角、月出月落、月球视半径、折射和恒星自行计算 - 优化内外行星事件搜索、边界选择、极端输入处理和计算稳定性
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
"b612.me/astro/basic"
|
||||
eclipsecore "b612.me/astro/eclipse"
|
||||
"b612.me/astro/internal/svgasset"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -23,7 +24,7 @@ const (
|
||||
// LunarEclipseSVGOptions 控制月食穿影 SVG 输出。
|
||||
// LunarEclipseSVGOptions controls lunar eclipse shadow-path SVG output.
|
||||
type LunarEclipseSVGOptions struct {
|
||||
// Width / Height 是 SVG 画布尺寸;<=0 时使用默认尺寸。
|
||||
// Width 和 Height 是 SVG 画布尺寸;<=0 时使用默认尺寸。
|
||||
// Width/Height are SVG canvas size; values <= 0 use defaults.
|
||||
Width int
|
||||
Height int
|
||||
@@ -168,7 +169,7 @@ func renderLunarEclipseSVG(
|
||||
var b strings.Builder
|
||||
fmt.Fprintf(&b, `<svg xmlns="http://www.w3.org/2000/svg" width="%d" height="%d" viewBox="0 0 %d %d">`, options.Width, options.Height, options.Width, options.Height)
|
||||
b.WriteString(`<defs>`)
|
||||
b.WriteString(lunarEclipseSVGMoonSymbol)
|
||||
b.WriteString(svgasset.MoonFaceSymbol())
|
||||
b.WriteString(`</defs>`)
|
||||
b.WriteString(`<rect width="100%" height="100%" fill="#efefed"/>`)
|
||||
fmt.Fprintf(&b, `<rect x="22" y="18" width="%.3f" height="%.3f" fill="#ffffff" stroke="#c9c9c6" stroke-width="1.2"/>`,
|
||||
|
||||
Reference in New Issue
Block a user