<p>Assuming that you used the time of 170900 EDT(-4 UT), which is 230900 UT, the following is my math:</p>

<p>Let the Julian Date for 25Mar2016 at 230900, which is 2457473.464583, be set to JD;</p>

<p>Given the formula (on Wikipedia:n = JD - 2451545.0 ), your n is 5928.464583.
Then, taking the second formula ( g = 357.528° + 0.9856003° * n ) you get g=357.528°+5843.0964715441749 = 6200.3544715441749 mod 360 = +80.35447°.  Were you to round up this would give +80.4.</p>

<p>Without how you handled your date/time in c++ and your rounding, I would wager that is were the error occurred.</p>

CC BY-SA 3.0
2016-03-30T15:42:57.140Z
2016-03-30T15:42:57.140Z
Lee
<p>The formulae on wikipedia are correct. </p>

<p>As you haven't explained where you have "80.4" from, this answer is a "best effort".</p>

<p>The value you have calculated is close, so there may be a small error in your code. My guess is that you haven't correctly calculated the time as a Julian Day Number. The Julian Day changes at noon UT (probably as this means that the Julian Day doesn't change during the European night) Whereas most other systems of dates start and end at midnight. This can easily introduce a 12 hour error into your calculations. When you say "number of days since Jan 1 2000, are you starting your counting at noon or midnight?</p>

CC BY-SA 3.0
2016-03-26T23:33:44.590Z
2016-03-26T23:33:44.590Z
James K
<p>I'm creating a C++ program that calculates the ecliptic coordinates based on the formulae from <a href="https://en.wikipedia.org/wiki/Position_of_the_Sun" rel="nofollow">Wikipedia</a> But, my calculations appear off. The mean anomaly for today, for example, should be 80.4-something; both my program and Google calculate approx. 79.2 - the result of (357.528 + 0.9856003*5927) % 360 (where 5927 is the number of days since January 1, 2000, GMT) </p>

CC BY-SA 3.0
2016-03-25T19:19:48.913Z
where are you getting the 80.4 from?
costrom
<the-sun><positional-astronomy>
Are Wikipedia's sun ecliptic-coordinate formulae accurate?
moonman239
# Are Wikipedia's sun ecliptic-coordinate formulae accurate?

(Asked by: username_0 on 2016-03-25)

I'm creating a C++ program that calculates the ecliptic coordinates based on the formulae from [Wikipedia](https://en.wikipedia.org/wiki/Position_of_the_Sun) But, my calculations appear off. The mean anomaly for today, for example, should be 80.4-something; both my program and Google calculate approx. 79.2 - the result of (357.528 + 0.9856003\*5927) % 360 (where 5927 is the number of days since January 1, 2000, GMT)

**Tags:** the-sun, positional-astronomy

> **Comments:**
> **username_1**: where are you getting the 80.4 from?  

---

## 2 answers

### Answer by username_2 on 2016-03-30. Score: 1

Assuming that you used the time of 170900 EDT(-4 UT), which is 230900 UT, the following is my math:

Let the Julian Date for 25Mar2016 at 230900, which is 2457473.464583, be set to JD;

Given the formula (on Wikipedia:n = JD - 2451545.0 ), your n is 5928.464583.
Then, taking the second formula ( g = 357.528° + 0.9856003° \* n ) you get g=357.528°+5843.0964715441749 = 6200.3544715441749 mod 360 = +80.35447°. Were you to round up this would give +80.4.

Without how you handled your date/time in c++ and your rounding, I would wager that is were the error occurred.


---

### Answer by username_3 on 2016-03-26. Score: 0

The formulae on wikipedia are correct.

As you haven't explained where you have "80.4" from, this answer is a "best effort".

The value you have calculated is close, so there may be a small error in your code. My guess is that you haven't correctly calculated the time as a Julian Day Number. The Julian Day changes at noon UT (probably as this means that the Julian Day doesn't change during the European night) Whereas most other systems of dates start and end at midnight. This can easily introduce a 12 hour error into your calculations. When you say "number of days since Jan 1 2000, are you starting your counting at noon or midnight?


---

