moon

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: 8 Imported by: 0

Documentation

Overview

Moon: Chapter 53, Ephemeris for Physical Observations of the Moon.

Incomplete. Topocentric functions are commented out for lack of test data.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Physical

func Physical(jde float64, earth *pp.V87Planet) (l, b, P, l0, b0 unit.Angle)

Physical returns quantities useful for physical observation of the Moon.

Returned l, b are librations in selenographic longitude and latitude. They represent combined optical and physical librations. Topocentric librations are not considered.

Returned P is the the position angle of the Moon's axis of rotation.

Returned l0, b0 are the selenographic coordinates of the Sun.

Example
package main

import (
	"fmt"

	"github.com/soniakeys/meeus/v3/julian"
	"github.com/soniakeys/meeus/v3/moon"

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

func main() {
	j := julian.CalendarGregorianToJD(1992, 4, 12)
	earth, err := pp.LoadPlanet(pp.Earth)
	if err != nil {
		fmt.Println(err)
		return
	}
	l, b, P, l0, b0 := moon.Physical(j, earth)
	fmt.Printf("l = %.2f\n", l.Deg())
	fmt.Printf("b = %+.2f\n", b.Deg())
	fmt.Printf("P = %.2f\n", P.Deg())
	fmt.Printf("l0 = %.2f\n", l0.Deg())
	fmt.Printf("b0 = %+.2f\n", b0.Deg())
}
Output:

l = -1.23
b = +4.20
P = 15.08
l0 = 67.90
b0 = +1.46

func SunAltitude

func SunAltitude(η, θ, l0, b0 unit.Angle) unit.Angle

SunAltitude returns altitude of the Sun above the lunar horizon.

Arguments η, θ are selenographic longitude and latitude of a site on the Moon, l0, b0 are selenographic coordinates of the Sun, as returned by Physical(), for example.

Example
package main

import (
	"fmt"

	"github.com/soniakeys/meeus/v3/julian"
	"github.com/soniakeys/meeus/v3/moon"

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

func main() {
	j := julian.CalendarGregorianToJD(1992, 4, 12)
	earth, err := pp.LoadPlanet(pp.Earth)
	if err != nil {
		fmt.Println(err)
		return
	}
	_, _, _, l0, b0 := moon.Physical(j, earth)
	h := moon.SunAltitude(
		unit.AngleFromDeg(-20), unit.AngleFromDeg(9.7), l0, b0)
	fmt.Printf("%+.3f\n", h.Deg())
}
Output:

+2.318

func Sunrise

func Sunrise(η, θ unit.Angle, jde float64, earth *pp.V87Planet) float64

Sunrise returns time of sunrise for a point on the Moon near the given date.

Arguments η, θ are selenographic longitude and latitude of a site on the Moon, jde can be any date.

Returned is the time of sunrise as a jde nearest the given jde.

Example
package main

import (
	"fmt"
	"time"

	"github.com/soniakeys/meeus/v3/julian"
	"github.com/soniakeys/meeus/v3/moon"

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

func main() {
	earth, err := pp.LoadPlanet(pp.Earth)
	if err != nil {
		fmt.Println(err)
		return
	}
	j0 := julian.CalendarGregorianToJD(1992, 4, 15)
	j := moon.Sunrise(
		unit.AngleFromDeg(-20), unit.AngleFromDeg(9.7), j0, earth)
	y, m, d := julian.JDToCalendar(j)
	fmt.Printf("%d %s %.4f TD\n", y, time.Month(m), d)
}
Output:

1992 April 11.8069 TD

func Sunset

func Sunset(η, θ unit.Angle, jde float64, earth *pp.V87Planet) float64

Sunset returns time of sunset for a point on the Moon near the given date.

Arguments η, θ are selenographic longitude and latitude of a site on the Moon, jde can be any date.

Returned is the time of sunset as a jde nearest the given jde.

Types

This section is empty.

Jump to

Keyboard shortcuts

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