Exemplo n.º 1
0
// MoonTopocentric returns observed topocentric semidiameter of the Moon.
//
//	Δ is distance to Moon in AU.
//	δ is declination of Moon.
//	H is hour angle of Moon.
//	ρsφʹ, ρcφʹ are parallax constants as returned by
//	    globe.Ellipsoid.ParallaxConstants, for example.
func MoonTopocentric(Δ float64, δ unit.Angle, H unit.HourAngle, ρsφʹ, ρcφʹ float64) float64 {
	const k = .272481
	sπ := parallax.Horizontal(Δ).Sin()
	// q computed by (40.6, 40.7) p. 280, ch 40.
	sδ, cδ := δ.Sincos()
	sH, cH := H.Sincos()
	A := cδ * sH
	B := cδ*cH - ρcφʹ*sπ
	C := sδ - ρsφʹ*sπ
	q := math.Sqrt(A*A + B*B + C*C)
	return k / q * sπ
}
Exemplo n.º 2
0
// ParallacticAngle returns parallactic angle of a celestial object.
//
//	φ is geographic latitude of observer.
//	δ is declination of observed object.
//	H is hour angle of observed object.
func ParallacticAngle(φ, δ unit.Angle, H unit.HourAngle) unit.Angle {
	sδ, cδ := δ.Sincos()
	sH, cH := H.Sincos()
	// (14.1) p. 98
	return unit.Angle(math.Atan2(sH, φ.Tan()*cδ-sδ*cH))
}