9ee2163cc7
- 新增月掩恒星和行星:支持搜索、掩甚点、全球掩带及固定地点轨迹计算 - 支持恒星星表坐标转换、有限盘面行星接触事件和月掩 SVG 输出 - 新增日月食及月掩全球投影图、时间标记和 GeoJSON 地理数据接口 - 扩展日食中心线、南北界及偏食足迹采样,支持极区投影 - 修正站心时角、月出月落、月球视半径、折射和恒星自行计算 - 优化内外行星事件搜索、边界选择、极端输入处理和计算稳定性
33 lines
1.8 KiB
Go
33 lines
1.8 KiB
Go
package svgmap
|
|
|
|
import "b612.me/astro/internal/geodata"
|
|
|
|
// SphericalCircle 返回球面小圆上的等间隔采样点 / SphericalCircle returns evenly spaced points on a small circle on the
|
|
// 球面小圆;方位角从地理北方顺时针采样 / sphere. Bearings are sampled clockwise from geographic north.
|
|
func SphericalCircle(center GeoPoint, radiusDegrees float64, points int) []GeoPoint {
|
|
return geodata.SphericalCircle(center, radiusDegrees, points)
|
|
}
|
|
|
|
// JoinPolylineSegments 按最近端点连接无序边界线段 / JoinPolylineSegments joins unordered boundary segments by their nearest
|
|
// 端点连接;输入线段不会被修改 / endpoints. The input segments are not modified.
|
|
func JoinPolylineSegments(segments [][]GeoPoint) []GeoPoint {
|
|
return geodata.JoinPolylineSegments(segments)
|
|
}
|
|
|
|
// ShortestCircleArc 返回两点之间较短的采样圆弧 / ShortestCircleArc returns the shorter sampled arc from one point to another.
|
|
func ShortestCircleArc(circle []GeoPoint, from, to GeoPoint) []GeoPoint {
|
|
return geodata.ShortestCircleArc(circle, from, to)
|
|
}
|
|
|
|
// SameGeoPoint 判断两个经纬度点是否在拓扑所需精度内相等 / SameGeoPoint reports whether two longitude/latitude points are equal within
|
|
// 地图拓扑辅助函数所需的精度内相等 / the precision needed by the map topology helpers.
|
|
func SameGeoPoint(a, b GeoPoint) bool {
|
|
return geodata.SameGeoPoint(a, b)
|
|
}
|
|
|
|
// VisibleHemispherePolygons 返回以指定中心为中心的半球多边形 / VisibleHemispherePolygons returns polygons for the hemisphere centered on
|
|
// 中心的半球多边形,并裁剪到请求的地图投影 / center, clipped to the requested map projection.
|
|
func VisibleHemispherePolygons(center GeoPoint, projection Projection, samples int) [][]GeoPoint {
|
|
return geodata.VisibleHemispherePolygons(center, projection, samples)
|
|
}
|