// ReduceElements reduces orbital elements of a solar system body from one // equinox to another. // // This function is described in chapter 24, but is located in this // package so it can be a method of EclipticPrecessor. func (p *EclipticPrecessor) ReduceElements(eFrom, eTo *elementequinox.Elements) *elementequinox.Elements { ψ := p.π + p.p si, ci := math.Sincos(eFrom.Inc) snp, cnp := math.Sincos(eFrom.Node - p.π) // (24.1) p. 159 eTo.Inc = math.Acos(ci*p.cη + si*p.sη*cnp) // (24.2) p. 159 eTo.Node = math.Atan2(si*snp, p.cη*si*cnp-p.sη*ci) + ψ // (24.3) p. 159 eTo.Peri = math.Atan2(-p.sη*snp, si*p.cη-ci*p.sη*cnp) + eFrom.Peri return eTo }
// ReduceElements reduces orbital elements of a solar system body from one // equinox to another. // // This function is described in chapter 24, but is located in this // package so it can be a method of EclipticPrecessor. func (p *EclipticPrecessor) ReduceElements(eFrom, eTo *elementequinox.Elements) *elementequinox.Elements { ψ := p.π + p.p si, ci := eFrom.Inc.Sincos() snp, cnp := (eFrom.Node - p.π).Sincos() // (24.1) p. 159 eTo.Inc = unit.Angle(math.Acos(ci*p.cη + si*p.sη*cnp)) // (24.2) p. 159 eTo.Node = ψ + unit.Angle(math.Atan2(si*snp, p.cη*si*cnp-p.sη*ci)) // (24.3) p. 160 eTo.Peri = eFrom.Peri + unit.Angle(math.Atan2(-p.sη*snp, si*p.cη-ci*p.sη*cnp)) return eTo }