示例#1
0
func TestSepHav(t *testing.T) {
	// Example 17.a, p. 110.
	r1 := unit.NewRA(14, 15, 39.7).Angle()
	d1 := unit.NewAngle(' ', 19, 10, 57)
	r2 := unit.NewRA(13, 25, 11.6).Angle()
	d2 := unit.NewAngle('-', 11, 9, 41)
	d := angle.SepHav(r1, d1, r2, d2)
	s := fmt.Sprint(sexa.FmtAngle(d))
	if s != "32°47′35″" {
		t.Fatal(s)
	}
}
示例#2
0
文件: angle_test.go 项目: pjh59/meeus
func TestSepHav(t *testing.T) {
	// Example 17.a, p. 110.
	r1 := base.NewRA(14, 15, 39.7).Rad()
	d1 := base.NewAngle(false, 19, 10, 57).Rad()
	r2 := base.NewRA(13, 25, 11.6).Rad()
	d2 := base.NewAngle(true, 11, 9, 41).Rad()
	d := angle.SepHav(r1, d1, r2, d2)
	s := fmt.Sprint(base.NewFmtAngle(d))
	if s != "32°47′35″" {
		t.Fatal(s)
	}
}