Documentation
¶
Overview ¶
Stellar: Chapter 56, Stellar Magnitudes.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsoluteByDistance ¶
AbsoluteByDistance returns absolute magnitude given distance. 距离+视星等计算绝对星等
Argument m is apparent magnitude, d is distance in parsecs.
func AbsoluteByParallax ¶
AbsoluteByParallax returns absolute magnitude given annual parallax. 秒差距+视星等计算绝对星等 恒星的绝对星等是指:我们位于距恒星10(秒差距)的地方得到的恒星视星等
Argument m is apparent magnitude, π is annual parallax.
func Difference ¶
Difference returns the difference in apparent magnitude of two stars given their brightness ratio. 通过亮度比计算两个恒星的星等差
Example ¶
package main
import (
"fmt"
"github.com/mooncaker816/learnmeeus/v3/stellar"
)
func main() {
// Example 56.e, p. 395
fmt.Printf("%.2f\n", stellar.Difference(500))
}
Output: 6.75
func Ratio ¶
Ratio returns the brightness ratio of two stars. 天体1和天体2的视亮度比
Arguments m1, m2 are apparent magnitudes.
Example ¶
package main
import (
"fmt"
"github.com/mooncaker816/learnmeeus/v3/stellar"
)
func main() {
// Example 56.d, p. 395
fmt.Printf("%.2f\n", stellar.Ratio(.14, 2.12))
}
Output: 6.19
func Sum ¶
Sum returns the combined apparent magnitude of two stars. 2个恒星的合星等
Example ¶
package main
import (
"fmt"
"github.com/mooncaker816/learnmeeus/v3/stellar"
)
func main() {
// Example 56.a, p. 393
fmt.Printf("%.2f\n", stellar.Sum(1.96, 2.89))
}
Output: 1.58
func SumN ¶
SumN returns the combined apparent magnitude of a number of stars. n个恒星的合星等
Example (Cluster) ¶
package main
import (
"fmt"
"github.com/mooncaker816/learnmeeus/v3/stellar"
)
func main() {
// Example 56.c, p. 394
var c []float64
for i := 0; i < 4; i++ {
c = append(c, 5)
}
for i := 0; i < 14; i++ {
c = append(c, 6)
}
for i := 0; i < 23; i++ {
c = append(c, 7)
}
for i := 0; i < 38; i++ {
c = append(c, 8)
}
fmt.Printf("%.2f\n", stellar.SumN(c...))
}
Output: 2.02
Example (Triple) ¶
package main
import (
"fmt"
"github.com/mooncaker816/learnmeeus/v3/stellar"
)
func main() {
// Example 56.b, p. 394
fmt.Printf("%.2f\n", stellar.SumN(4.73, 5.22, 5.6))
}
Output: 3.93
Types ¶
This section is empty.