orbit

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package orbit propagates lightweight Sun-centered two-body conic orbits.

Supported input styles:

  • classical elliptic elements: A/E/I/Omega/W/M0 at EpochJD
  • perihelion form: Q/E/I/Omega/W/TpJD for high-eccentricity, parabolic, or hyperbolic comet-like trajectories

All input angles are in degrees. EpochJD and TpJD are TT/TDB Julian days. Returned geometric positions do not include perturbations beyond the supplied elements. Astrometric results include down-leg light-time correction. Apparent results follow this repository's existing planet semantics: astrometric position plus nutation/of-date coordinate conversion, without a full external aberration model. The package also provides observer-facing altitude/azimuth/hour-angle and rise/transit/set helpers built on top of the apparent topocentric coordinates. Rise/set helpers return package-local sentinel errors ERR_ORBIT_NEVER_RISE / ERR_ORBIT_NEVER_SET, matching the convention used by other public observation packages in this repository.

In addition, the package includes a small classical visual-binary helper based on the standard P/T/e/a/i/Omega/omega element set, returning apparent position angle and separation on the sky.

Index

Constants

This section is empty.

Variables

View Source
var (
	ERR_ORBIT_NEVER_RISE = errors.New("ERROR:轨道目标今日永远在地平线下!")
	ERR_ORBIT_NEVER_SET  = errors.New("ERROR:轨道目标今日永远在地平线上!")
)

Functions

func Altitude

func Altitude(date time.Time, elements Elements, observerLon, observerLat, observerHeight float64) float64

Altitude 视高度角 / apparent altitude.

返回目标在观测者所在地的视高度角,单位度;经度东正西负,纬度北正南负,海拔单位米。

func AsteroidMagnitudeHG

func AsteroidMagnitudeHG(date time.Time, elements Elements, absoluteMagnitude, slopeParameter float64) float64

AsteroidMagnitudeHG 小行星 H-G 模型视星等 / asteroid apparent magnitude using the H-G model.

absoluteMagnitude 为绝对星等 H,slopeParameter 为斜率参数 G。 absoluteMagnitude is the absolute magnitude H, and slopeParameter is the slope parameter G.

func Azimuth

func Azimuth(date time.Time, elements Elements, observerLon, observerLat, observerHeight float64) float64

Azimuth 视方位角 / apparent azimuth.

返回目标在观测者所在地的视方位角,按正北为 0°、向东增加。

func CulminationTime

func CulminationTime(date time.Time, elements Elements, observerLon, observerLat, observerHeight float64) time.Time

CulminationTime 中天时刻 / culmination time.

返回目标在给定当地日期内的中天时刻,结果保持输入 `date` 的时区。

func EarthDistance

func EarthDistance(date time.Time, elements Elements) float64

EarthDistance 地心距离 / Earth distance.

返回轨道目标在 date 对应绝对时刻到地球的几何距离,单位 AU。 Returns the geometric distance from the orbiting target to Earth at the instant represented by date, in astronomical units.

func Elongation

func Elongation(date time.Time, elements Elements) float64

Elongation 日距角 / elongation.

返回轨道目标与太阳在地心视方向上的角距,单位度。 Returns the apparent geocentric angular separation between the target and the Sun, in degrees.

func HourAngle

func HourAngle(date time.Time, elements Elements, observerLon, observerLat, observerHeight float64) float64

HourAngle 站心视时角 / topocentric hour angle.

返回目标在观测者所在地的站心视时角,单位度。

func IlluminatedFraction

func IlluminatedFraction(date time.Time, elements Elements) float64

IlluminatedFraction 被照亮比例 / illuminated fraction.

返回轨道目标被太阳照亮的可见比例,范围通常为 [0, 1]。 Returns the illuminated fraction of the target, typically in the range [0, 1].

func MeanAnomaly

func MeanAnomaly(date time.Time, elements Elements) float64

MeanAnomaly 平近点角 / mean anomaly.

返回给定时刻的平近点角,单位度;对抛物线和双曲线轨道返回 `NaN`。

func MeanMotion

func MeanMotion(elements Elements) float64

MeanMotion 平均角速度 / mean motion.

返回平均角速度,单位度/日;对抛物线和双曲线轨道返回 `NaN`。

func ParallacticAngle

func ParallacticAngle(date time.Time, elements Elements, observerLon, observerLat, observerHeight float64) float64

ParallacticAngle 轨道目标视差角(天顶方向角) / orbit-target parallactic angle.

返回轨道目标在观测者所在地的视差角,单位度;`observerLon` 东经为正,`observerLat` 北纬为正,`observerHeight` 单位米。

func Phase

func Phase(date time.Time, elements Elements) float64

Phase 相位 / phase.

返回轨道目标被照亮比例,是 IlluminatedFraction 的别名。 Returns the illuminated fraction of the target and is an alias of IlluminatedFraction.

func PhaseAngle

func PhaseAngle(date time.Time, elements Elements) float64

PhaseAngle 相位角 / phase angle.

返回轨道目标的相位角,单位度。 Returns the phase angle of the orbiting target, in degrees.

func RiseTime

func RiseTime(date time.Time, elements Elements, observerLon, observerLat, observerHeight float64, aero bool) (time.Time, error)

RiseTime 升起时刻 / rise time.

返回目标在给定当地日期内的升起时刻;`aero=true` 时加入标准大气折射修正。

func SetTime

func SetTime(date time.Time, elements Elements, observerLon, observerLat, observerHeight float64, aero bool) (time.Time, error)

SetTime 落下时刻 / set time.

返回目标在给定当地日期内的落下时刻;`aero=true` 时加入标准大气折射修正。

func SunDistance

func SunDistance(date time.Time, elements Elements) float64

SunDistance 日心距离 / Sun distance.

返回轨道目标在 date 对应绝对时刻到太阳的几何距离,单位 AU。 Returns the geometric distance from the orbiting target to the Sun at the instant represented by date, in astronomical units.

func TrueAnomaly

func TrueAnomaly(date time.Time, elements Elements) float64

TrueAnomaly 真近点角 / true anomaly.

返回给定时刻的真近点角,单位度。

func Zenith

func Zenith(date time.Time, elements Elements, observerLon, observerLat, observerHeight float64) float64

Zenith 天顶距 / zenith distance.

返回目标在观测者所在地的天顶距,单位度。

Types

type EclipticPosition

type EclipticPosition struct {
	Lon      float64
	Lat      float64
	Distance float64
}

EclipticPosition 黄道球坐标结果,Lon/Lat 单位度,Distance 单位 AU。

func ApparentGeocentricEcliptic

func ApparentGeocentricEcliptic(date time.Time, elements Elements) EclipticPosition

ApparentGeocentricEcliptic 地心视黄道坐标 / apparent geocentric ecliptic coordinates.

返回加入光行时与章动修正后的地心视黄经、黄纬和距离;角度单位度,距离单位 AU。

func GeocentricEcliptic

func GeocentricEcliptic(date time.Time, elements Elements) EclipticPosition

GeocentricEcliptic 地心历元黄道坐标 / geocentric ecliptic coordinates of date.

返回历元黄经、黄纬和距离;角度单位度,距离单位 AU。

func GeocentricEclipticJ2000

func GeocentricEclipticJ2000(date time.Time, elements Elements) EclipticPosition

GeocentricEclipticJ2000 地心 J2000 平黄道坐标 / geocentric J2000 ecliptic coordinates.

返回黄经、黄纬和距离;角度单位度,距离单位 AU。

func HeliocentricEcliptic

func HeliocentricEcliptic(date time.Time, elements Elements) EclipticPosition

HeliocentricEcliptic 日心历元黄道坐标 / heliocentric ecliptic coordinates of date.

返回历元黄经、黄纬和距离;角度单位度,距离单位 AU。

func HeliocentricEclipticJ2000

func HeliocentricEclipticJ2000(date time.Time, elements Elements) EclipticPosition

HeliocentricEclipticJ2000 日心 J2000 平黄道坐标 / heliocentric J2000 ecliptic coordinates.

返回黄经、黄纬和距离;角度单位度,距离单位 AU。

type Elements

type Elements struct {
	EpochJD float64 // 历元儒略日(TT/TDB) / epoch Julian day in TT/TDB.
	A       float64 // 半长径,单位 AU / semi-major axis in AU.
	E       float64 // 离心率 / eccentricity.
	I       float64 // 轨道倾角,单位度 / inclination in degrees.
	Omega   float64 // 升交点黄经,单位度 / longitude of ascending node in degrees.
	W       float64 // 近日点幅角,单位度 / argument of perihelion in degrees.
	M0      float64 // 历元平近点角,单位度 / mean anomaly at epoch in degrees.
	Q       float64 // 近日点距离,单位 AU / perihelion distance in AU.
	TpJD    float64 // 近日点通过时刻(TT/TDB JD) / perihelion passage time in TT/TDB Julian day.

	ADot     float64 // 半长径日变化,单位 AU/day / daily rate of A.
	EDot     float64 // 离心率日变化,单位 1/day / daily rate of E.
	IDot     float64 // 倾角日变化,单位 deg/day / daily rate of I.
	OmegaDot float64 // 升交点黄经日变化,单位 deg/day / daily rate of Omega.
	WDot     float64 // 近日点幅角日变化,单位 deg/day / daily rate of W.
	MDot     float64 // 平近点角日变化,单位 deg/day / daily rate of M.
}

Elements 日心二体圆锥曲线根数,参考系为 J2000 平黄道/平春分点。 EpochJD 与 TpJD 使用 TT/TDB 对应的儒略日。

经典椭圆根数:A/E/I/Omega/W/M0 近日点形式:Q/E/I/Omega/W/TpJD

线性 rates 仅作用于经典椭圆根数,单位均为每天变化量。

type EquatorialPosition

type EquatorialPosition struct {
	RA       float64
	Dec      float64
	Distance float64
}

EquatorialPosition 赤道球坐标结果,RA/Dec 单位度,Distance 单位 AU。

func ApparentGeocentricEquatorial

func ApparentGeocentricEquatorial(date time.Time, elements Elements) EquatorialPosition

ApparentGeocentricEquatorial 地心视赤道坐标 / apparent geocentric equatorial coordinates.

返回加入光行时与章动修正后的地心视赤经、赤纬和距离;角度单位度,距离单位 AU。

func ApparentTopocentricEquatorial

func ApparentTopocentricEquatorial(date time.Time, elements Elements, observerLon, observerLat, observerHeight float64) EquatorialPosition

ApparentTopocentricEquatorial 站心视赤道坐标 / apparent topocentric equatorial coordinates.

返回加入光行时、章动和站心修正后的视赤经、赤纬和距离; `observerLon` 东经为正,`observerLat` 北纬为正,`observerHeight` 单位米。

func AstrometricGeocentricEquatorialJ2000

func AstrometricGeocentricEquatorialJ2000(date time.Time, elements Elements) EquatorialPosition

AstrometricGeocentricEquatorialJ2000 地心测算 J2000 赤道坐标 / astrometric geocentric J2000 equatorial coordinates.

返回加入光行时修正后的地心 J2000 赤经、赤纬和距离;角度单位度,距离单位 AU。

func GeocentricEquatorial

func GeocentricEquatorial(date time.Time, elements Elements) EquatorialPosition

GeocentricEquatorial 地心历元平赤道坐标 / geocentric equatorial coordinates of date.

返回历元赤经、赤纬和距离;角度单位度,距离单位 AU。

func GeocentricEquatorialJ2000

func GeocentricEquatorialJ2000(date time.Time, elements Elements) EquatorialPosition

GeocentricEquatorialJ2000 地心 J2000 平赤道坐标 / geocentric J2000 equatorial coordinates.

返回赤经、赤纬和距离;角度单位度,距离单位 AU。

type VisualBinaryElements

type VisualBinaryElements struct {
	PeriodYears        float64 // 周期 P,单位平太阳年 / orbital period in mean solar years.
	PeriastronYear     float64 // 过近星点时刻 T,采用带小数的年 / epoch of periastron as a decimal year.
	Eccentricity       float64 // 离心率 e / eccentricity.
	SemiMajorAxis      float64 // 半长轴 a,单位角秒 / semi-major axis in arcseconds.
	Inclination        float64 // 倾角 i,单位度 / inclination in degrees.
	AscendingNode      float64 // 升交点位置角 Ω,单位度 / position angle of ascending node in degrees.
	PeriastronArgument float64 // 近星点角距 ω,单位度 / argument of periastron in degrees.
}

VisualBinaryElements 视双星轨道要素,采用《天文算法》第 55 章的经典口径。

type VisualBinaryPosition

type VisualBinaryPosition struct {
	Year             float64 // 计算使用的小数年 / decimal year used for the evaluation.
	MeanAnomaly      float64 // 平近点角 M,单位度 / mean anomaly in degrees.
	EccentricAnomaly float64 // 偏近点角 E,单位度 / eccentric anomaly in degrees.
	TrueAnomaly      float64 // 真近点角 v,单位度 / true anomaly in degrees.
	Radius           float64 // 径矢 r,单位角秒 / radius vector in arcseconds.
	PositionAngle    float64 // 位置角 θ,北为 0°、东为 90° / position angle, north through east.
	Separation       float64 // 角距离 ρ,单位角秒 / apparent separation in arcseconds.
}

VisualBinaryPosition 视双星在天球上的计算结果。

func VisualBinary

func VisualBinary(date time.Time, elements VisualBinaryElements) VisualBinaryPosition

VisualBinary 视双星位置 / visual binary position.

输入时刻会先换算为 UTC 小数年,再按经典视轨道公式求解。 The input instant is converted to a UTC decimal year before evaluation.

func VisualBinaryByYear

func VisualBinaryByYear(year float64, elements VisualBinaryElements) VisualBinaryPosition

VisualBinaryByYear 视双星位置(按小数年) / visual binary position by decimal year.

返回给定小数年对应的视双星位置角和角距离。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL