saturnmoons

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Saturnmoons: Chapter 46, Positions of the Satellites of Saturn

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Positions

func Positions(jde float64, earth, saturn *pp.V87Planet, pos *[8]XY)

Positions returns positions of the eight major moons of Saturn.

Results returned in argument pos, which must not be nil.

Result units are Saturn radii.

Example
package main

import (
	"fmt"

	pp "github.com/soniakeys/meeus/v3/planetposition"
	"github.com/soniakeys/meeus/v3/saturnmoons"
)

func main() {
	// Example 46.a, p. 334.
	earth, err := pp.LoadPlanet(pp.Earth)
	if err != nil {
		fmt.Println(err)
		return
	}
	saturn, err := pp.LoadPlanet(pp.Saturn)
	if err != nil {
		fmt.Println(err)
		return
	}
	var pos [8]saturnmoons.XY
	saturnmoons.Positions(2451439.50074, earth, saturn, &pos)
	for i := range pos {
		fmt.Printf("%d:  %+7.3f  %+7.3f\n", i+1, pos[i].X, pos[i].Y)
	}
}
Output:

1:   +3.102   -0.204
2:   +3.823   +0.318
3:   +4.027   -1.061
4:   -5.365   -1.148
5:   -0.972   -3.136
6:  +14.568   +4.738
7:  -18.001   -5.328
8:  -48.760   +4.137

Types

type XY

type XY struct{ X, Y float64 }

XY holds coordinates returned from Positions().

Jump to

Keyboard shortcuts

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