本文整理汇总了Golang中github.com/soniakeys/meeus/planetposition.V87Planet.Position2000方法的典型用法代码示例。如果您正苦于以下问题:Golang V87Planet.Position2000方法的具体用法?Golang V87Planet.Position2000怎么用?Golang V87Planet.Position2000使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/soniakeys/meeus/planetposition.V87Planet
的用法示例。
在下文中一共展示了V87Planet.Position2000方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: xyz
func xyz(e *pp.V87Planet, jde float64) (x, y, z float64) {
l, b, r := e.Position2000(jde)
s := l + math.Pi
β := -b
ss, cs := math.Sincos(s)
sβ, cβ := math.Sincos(β)
// (26.2) p. 172
x = r * cβ * cs
y = r * cβ * ss
z = r * sβ
return
}
示例2: ap2a
func ap2a(j1, d float64, a bool, v *pp.V87Planet) (jde, r float64) {
// Meeus doesn't give a complete algorithm for finding accurate answers.
// The algorithm here starts with the approximate result algorithm
// then crawls along the curve at resultion d until three points
// are found containing the desired extremum. It's slow if the starting
// point is far away (the case of Neptune) or if high accuracy is
// demanded. 1 day accuracy is generally quick.
j0 := j1 - d
j2 := j1 + d
rr := make([]float64, 3)
_, _, rr[0] = v.Position2000(j0)
_, _, rr[1] = v.Position2000(j1)
_, _, rr[2] = v.Position2000(j2)
for {
if a {
if rr[1] > rr[0] && rr[1] > rr[2] {
break
}
} else {
if rr[1] < rr[0] && rr[1] < rr[2] {
break
}
}
if rr[0] < rr[2] == a {
j0 = j1
j1 = j2
j2 += d
rr[0] = rr[1]
rr[1] = rr[2]
_, _, rr[2] = v.Position2000(j2)
} else {
j2 = j1
j1 = j0
j0 -= d
rr[2] = rr[1]
rr[1] = rr[0]
_, _, rr[0] = v.Position2000(j0)
}
}
l, err := interp.NewLen3(j0, j2, rr)
if err != nil {
panic(err) // unexpected.
}
jde, r, err = l.Extremum()
if err != nil {
panic(err) // unexpected.
}
return
}
示例3: LongitudeJ2000
// LongitudeJ2000 returns geometric longitude referenced to equinox J2000.
func LongitudeJ2000(e *pp.V87Planet, jde float64) (l float64) {
l, _, _ = e.Position2000(jde)
return base.PMod(l+math.Pi-.09033/3600*math.Pi/180, 2*math.Pi)
}
示例4: LongitudeJ2000
// LongitudeJ2000 returns geometric longitude referenced to equinox J2000.
func LongitudeJ2000(e *pp.V87Planet, jde float64) (l unit.Angle) {
l, _, _ = e.Position2000(jde)
return (l + math.Pi - unit.AngleFromSec(.09033)).Mod1()
}