stellar

package
v3.0.0-...-8217f41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Stellar: Chapter 56, Stellar Magnitudes.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsoluteByDistance

func AbsoluteByDistance(m, d float64) float64

AbsoluteByDistance returns absolute magnitude given distance. 距离+视星等计算绝对星等

Argument m is apparent magnitude, d is distance in parsecs.

func AbsoluteByParallax

func AbsoluteByParallax(m float64, π unit.Angle) float64

AbsoluteByParallax returns absolute magnitude given annual parallax. 秒差距+视星等计算绝对星等 恒星的绝对星等是指:我们位于距恒星10(秒差距)的地方得到的恒星视星等

Argument m is apparent magnitude, π is annual parallax.

func Difference

func Difference(ratio float64) float64

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

func Ratio(m1, m2 float64) float64

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

func Sum(m1, m2 float64) float64

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

func SumN(m ...float64) float64

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL