Ejemplo n.º 1
0
func TestDiurnalPathAtHorizon(t *testing.T) {
	φ := 40 * math.Pi / 180
	ε := 23.44 * math.Pi / 180
	J := parallactic.DiurnalPathAtHorizon(0, φ)
	Jexp := math.Pi/2 - φ
	if math.Abs((J-Jexp)/Jexp) > 1e-15 {
		t.Fatal("0 dec:", base.NewFmtAngle(J))
	}
	J = parallactic.DiurnalPathAtHorizon(ε, φ)
	Jexp = base.NewAngle(false, 45, 31, 0).Rad()
	if math.Abs((J-Jexp)/Jexp) > 1e-3 {
		t.Fatal("solstace:", base.NewFmtAngle(J))
	}
}
Ejemplo n.º 2
0
func TestDiurnalPathAtHorizon(t *testing.T) {
	φ := unit.AngleFromDeg(40)
	ε := unit.AngleFromDeg(23.44)
	J := parallactic.DiurnalPathAtHorizon(0, φ)
	Jexp := math.Pi/2 - φ
	if math.Abs((J-Jexp).Rad()/Jexp.Rad()) > 1e-15 {
		t.Fatal("0 dec:", sexa.FmtAngle(J))
	}
	J = parallactic.DiurnalPathAtHorizon(ε, φ)
	Jexp = unit.NewAngle(' ', 45, 31, 0)
	if math.Abs((J-Jexp).Rad()/Jexp.Rad()) > 1e-3 {
		t.Fatal("solstice:", sexa.FmtAngle(J))
	}
}