Practical Astronomy Algorithms in .NET/C#
Loading...
Searching...
No Matches
PASun.cs
Go to the documentation of this file.
1using System;
2using Xunit;
3
4namespace PALib.Tests;
5
6public class PASun_Tests
7{
8 private readonly PASun _paSun;
9
10 public PASun_Tests()
11 {
12 _paSun = new PASun();
13 }
14
15 [Fact]
17 {
18 Assert.Equal((8, 23, 33.73, 19, 21, 14.33), _paSun.ApproximatePositionOfSun(0, 0, 0, 27, 7, 2003, false, 0));
19 }
20
21 [Fact]
23 {
24 Assert.Equal((8, 26, 3.83, 19, 12, 49.72), _paSun.PrecisePositionOfSun(0, 0, 0, 27, 7, 1988, false, 0));
25 }
26
27 [Fact]
29 {
30 Assert.Equal((151920130, 0, 31, 29.93), _paSun.SunDistanceAndAngularSize(0, 0, 0, 27, 7, 1988, false, 0));
31 }
32
33 [Fact]
34 public void SunriseAndSunset()
35 {
36 Assert.Equal((6, 5, 17, 45, 94.83, 265.43, "OK"), _paSun.SunriseAndSunset(10, 3, 1986, false, -5, -71.05, 42.37));
37 }
38
39 [Fact]
41 {
42 Assert.Equal((3, 17, 20, 37, "OK"), _paSun.MorningAndEveningTwilight(7, 9, 1979, false, 0, 0, 52, PATwilightType.Astronomical));
43 }
44
45 [Fact]
46 public void EquationOfTime()
47 {
48 Assert.Equal((6, 31.52), _paSun.EquationOfTime(27, 7, 2010));
49 }
50
51 [Fact]
52 public void SolarElongation()
53 {
54 Assert.Equal(24.78, _paSun.SolarElongation(10, 6, 45, 11, 57, 27, 27.8333333, 7, 2010));
55 }
56}
Sun calculations.
Definition PASun.cs:10
double double double double double double sunDecSec PrecisePositionOfSun(double lctHours, double lctMinutes, double lctSeconds, double localDay, int localMonth, int localYear, bool isDaylightSaving, int zoneCorrection)
Definition PASun.cs:64
double double double double sunAngSizeSec SunDistanceAndAngularSize(double lctHours, double lctMinutes, double lctSeconds, double localDay, int localMonth, int localYear, bool isDaylightSaving, int zoneCorrection)
Definition PASun.cs:95
double double double double double double sunDecSec ApproximatePositionOfSun(double lctHours, double lctMinutes, double lctSeconds, double localDay, int localMonth, int localYear, bool isDaylightSaving, int zoneCorrection)
Definition PASun.cs:30
double double double double string status MorningAndEveningTwilight(double localDay, int localMonth, int localYear, bool isDaylightSaving, int zoneCorrection, double geographicalLongDeg, double geographicalLatDeg, PATwilightType twilightType)
Definition PASun.cs:176
double double equationOfTimeSec EquationOfTime(double gwdateDay, int gwdateMonth, int gwdateYear)
Definition PASun.cs:210
double double double double double double string status SunriseAndSunset(double localDay, int localMonth, int localYear, bool isDaylightSaving, int zoneCorrection, double geographicalLongDeg, double geographicalLatDeg)
Definition PASun.cs:129
double SolarElongation(double raHour, double raMin, double raSec, double decDeg, double decMin, double decSec, double gwdateDay, int gwdateMonth, int gwdateYear)
Calculate solar elongation for a celestial body.
Definition PASun.cs:230
void PrecisePositionOfSun()
Definition PASun.cs:22
readonly PASun _paSun
Definition PASun.cs:8
void ApproximatePositionOfSun()
Definition PASun.cs:16
void MorningAndEveningTwilight()
Definition PASun.cs:40
void SunDistanceAndAngularSize()
Definition PASun.cs:28
void SunriseAndSunset()
Definition PASun.cs:34
PATwilightType
Twilight type.
Definition PATypes.cs:28