

So there will be conversions between degrees and radians. Also, like many programming languages, C# requires arguments passed into trigonometric functions to be in radians. I’ll show how these are converted to between 0 and 360 degrees.

Because we’re dealing with long time spans (and multiple orbits) we will be dealing with very large angles.

The angle increases as the body moves in its orbit so that if it goes all the way around once it is 360 degrees. Notice the starting position in this figure: By Tfr000 – Own work, CC BY-SA 4.0, When calculating either one we start with an orbiting body at perihilion and the angle is zero degrees. The first is called the mean anomaly and the second is the true anomaly. There are two important angles with which we will be working. I want to say a few things about planetary motion to provide context. This value is going to be used in most every function below. See my Moment.cs struct in the source code for the calculations. From the previous post that gives us a T value of -0.42241. Note that you will need to download and install the free Microsoft Visual Studio Community Edition 2017 to build and run the code. For the complete software solution implemented in C# see my GitHub repo. I recommend reading an introductory article Position of the Sun before continuing. The goal here is to input any date and time (say the launch of Sputnik 1 on at 19:29 UTC) and get back the coordinates of the Sun as it appears to us on the celestial sphere at that moment. All page number references are to Meeus’ book. This algorithm is taken from Astronomical Algorithms by Jean Meeus (2nd Edition) with modifications from the U.S. Now I want to build on that to calculate the geocentric (or apparent) coordinates of the Sun for any given moment in time.
#Astronimal anomaly 2 a.d. how to#
In the last post I showed how to calculate the Julian Day (JD) and the Ephemeris Time (T).
