-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seems typo in interp.go, julian.go, sidereal.go, angle.go, nutation.go, solstice.go, illum.go, moonposition.go, moonillum.go, moonphase.go, moon.go #15
Comments
1 more typo found in func JDToCalendar(jd float64) (year, month int, day float64) {
zf, f := math.Modf(jd + .5)
z := int64(zf)
a := z
if z >= 2299151 {
α := base.FloorDiv64(z*100-186721625, 3652425)
a = z + 1 + α - base.FloorDiv64(α, 4)
} I have created 1 pull request #16 for above changes, pls kindly review. Thanks |
1 more found in var iau82 = []float64{24110.54841, 8640184.812866, 0.093104, 0.0000062} As per the IAU1982 Coeff, the 4th value should be -0.0000062, pls check. |
func Sep(r1, d1, r2, d2 unit.Angle) unit.Angle {
sd1, cd1 := d1.Sincos()
sd2, cd2 := d2.Sincos()
cd := sd1*sd2 + cd1*cd2*(r1-r2).Cos() // (17.1) p. 109
if cd < base.CosSmallAngle {
return unit.Angle(math.Acos(cd))
}
// (17.2) p. 109
return unit.Angle(math.Hypot((r2-r1).Rad()*cd1, (d2 - d1).Rad()))
}
func RelativePosition(r1, d1, r2, d2 unit.Angle) unit.Angle {
sΔr, cΔr := (r2 - r1).Sincos()
sd2, cd2 := d2.Sincos()
return unit.Angle(math.Atan2(sΔr, cd2*d1.Tan()-sd2*cΔr))
} |
1 typo in func Nutation(jde float64) (Δψ, Δε unit.Angle) {
T := base.J2000Century(jde)
D := base.Horner(T,
297.85036, 445267.11148, -0.0019142, 1./189474) * math.Pi / 180
M := base.Horner(T,
357.52772, 35999.050340, -0.0001603, -1./300000) * math.Pi / 180
N := base.Horner(T,
134.96298, 477198.867398, 0.0086972, 1./5620) * math.Pi / 180 |
in func Venus84(r, Δ float64, i unit.Angle) float64 {
return base.Horner(i.Deg(), -4.4+5*math.Log10(r*Δ),
.0009, -.000239, .00000065)
}
...
func Saturn84(r, Δ float64, B, ΔU unit.Angle) float64 {
s := math.Abs(B.Sin())
return -8.88 + 5*math.Log10(r*Δ) + .044/math.Abs(ΔU.Deg()) -
2.6*s + 1.25*s*s
} @commenthol , fyi :) |
My bad. Forget this comment... |
@commenthol ,should not be |
in func dmf(T float64) (D, M, Mʹ, F float64) {
D = base.Horner(T, 297.8501921*p, 445267.1114034*p,
-.0018819*p, p/545868, -p/113065000)
M = base.Horner(T, 357.5291092*p, 35999.0502909*p,
-.0001535*p, p/24490000)
Mʹ = base.Horner(T, 134.9633964*p, 477198.8675055*p,
.0087414*p, p/69699, -p/14712000)
F = base.Horner(T, 93.272095*p, 483202.0175233*p,
-.0036539*p, -p/3526000, p/863310000)
return
} func PhaseAngle3(jde float64) unit.Angle {
T := base.J2000Century(jde)
D := unit.AngleFromDeg(base.Horner(T, 297.8501921,
445267.1114034, -.0018819, 1/545868, -1/113065000)).Mod1().Rad()
M := unit.AngleFromDeg(base.Horner(T,
357.5291092, 35999.0502909, -.0001535, 1/24490000)).Mod1().Rad()
Mʹ := unit.AngleFromDeg(base.Horner(T, 134.9633964,
477198.8675055, .0087414, 1/69699, -1/14712000)).Mod1().Rad()
return math.Pi - unit.Angle(D) + unit.AngleFromDeg(
-6.289*math.Sin(Mʹ)+
2.1*math.Sin(M)+
-1.274*math.Sin(2*D-Mʹ)+
-.658*math.Sin(2*D)+
-.214*math.Sin(2*Mʹ)+
-.11*math.Sin(D))
} |
in func (m *moon) sun(λ, β unit.Angle, Δ float64, earth *pp.V87Planet) (l0, b0 unit.Angle) {
λ0, _, R := solar.ApparentVSOP87(earth, m.jde)
ΔR := unit.Angle(Δ / (R * base.AU))
λH := λ0 + math.Pi + ΔR.Mul(β.Cos()*(λ0-λ).Sin())
βH := ΔR * β
return m.lib(λH, βH)
} Also the 3rd Coeff of sun mean anomaly calculation is not correct(same issue as moonposition.go) |
Hi @soniakeys ,
First, thanks for your pretty library.
This is really nice to go thru "Astronomical Algorithms" chapter by chapter with individual packages.
It seems that there's little mismatch between your code and the algorithm listed in the book when i was reading chapter 3 Interpolation with package
interp
.algorithm in book (page 29):
the third coeff is
3(H+J)
code in interp.go:
the third coeff is
3 * (d.h + d.k)
, not3 * (d.h + d.j)
I guess this is a typo, pls kindly check.
The text was updated successfully, but these errors were encountered: