planetelements

package
v3.0.0-...-8217f41 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Planetelements: Chapter 31, Elements of Planetary Orbits.

Partial: Only implemented for mean equinox of date.

Index

Examples

Constants

View Source
const (
	Mercury = iota
	Venus
	Earth
	Mars
	Jupiter
	Saturn
	Uranus
	Neptune
)

Variables

This section is empty.

Functions

func Inc

func Inc(p int, jde float64) unit.Angle

Inc returns mean inclination for a planet at a date.

Result is the same as the Inc field returned by function Mean. That is, referenced to mean dynamical ecliptic and equinox of date.

func Mean

func Mean(p int, jde float64, e *Elements)

Mean returns mean orbital elements for a planet 计算行星轨道平要素

Argument p must be a planet const as defined above, argument e is a result parameter. A valid non-nil pointer to an Elements struct must be passed in.

Results are referenced to mean dynamical ecliptic and equinox of date.

Semimajor axis is in AU, angular elements are in radians.

Example
package main

import (
	"fmt"

	"github.com/mooncaker816/learnmeeus/v3/julian"
	pe "github.com/mooncaker816/learnmeeus/v3/planetelements"
)

func main() {
	// Example 31.a, p. 211
	j := julian.CalendarGregorianToJD(2065, 6, 24)
	var e pe.Elements
	pe.Mean(pe.Mercury, j, &e)
	fmt.Printf("L: %.6f\n", e.Lon.Deg())
	fmt.Printf("a: %.9f\n", e.Axis)
	fmt.Printf("e: %.8f\n", e.Ecc)
	fmt.Printf("i: %.6f\n", e.Inc.Deg())
	fmt.Printf("Ω: %.6f\n", e.Node.Deg())
	fmt.Printf("ϖ: %.6f\n", e.Peri.Deg())
}
Output:

L: 203.494701
a: 0.387098310
e: 0.20564510
i: 7.006171
Ω: 49.107650
ϖ: 78.475382

func Node

func Node(p int, jde float64) unit.Angle

Node returns mean longitude of ascending node for a planet at a date.

Result is the same as the Node field returned by function Mean. That is, radians, referenced to mean dynamical ecliptic and equinox of date.

Types

type Elements

type Elements struct {
	Lon  unit.Angle // mean longitude, L 行星平黄经
	Axis float64    // semimajor axis, a 轨道半长轴
	Ecc  float64    // eccentricity, e 轨道的离心率
	Inc  unit.Angle // inclination, i 行星轨道的倾角(与黄道的夹角)
	Node unit.Angle // longitude of ascending node, Ω 升交点黄经
	Peri unit.Angle // longitude of perihelion, ϖ (Meeus likes π better) 近日点经度
}

Elements contains orbital elements as returned by functions in this package.

Some other elements easily derived from these are

Mean Anomaly, M = Lon - Peri
Argument of Perihelion, ω = Peri - Node

Jump to

Keyboard shortcuts

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