# Is Earth's true anomaly roughly 1 degree currently?

I wrote software which uses GMT real time to calculate Earth's mean, eccentric, and true anomaly. I encountered a bug where after reaching 360 degrees, instead of flipping back to zero, it subtracts from 360.

So I checked Wolfram Alpha with search for Earth's true anomaly, just to see if we had passed through 0 degrees triggering the bug. As of a few days ago Wolfram and I were in agreement, approaching 360 degrees. But now Wolfram reads 179 degrees approx. I remember passing 180 in July or August.

So it appears Wolfram is also experiencing an error. To double check, true anomaly is the angle between Earth and perihelion side of major axis. We know Earth reaches its closest point to the Sun in the northern hemisphere winter, January roughly. And aphelion in summer months.

Additionally the j2000 epoch I uses 358 degrees roughly, putting the perihelion or closest approach right around early january roughly.

Thus I can only conclude Wolfram is in error as well?

• Cross-posted at physics.SE: physics.stackexchange.com/questions/451856/… Jan 3, 2019 at 15:44
• I'm voting to close this question as off-topic because the same question was asked earlier on physics.stackexchange.com . Jan 3, 2019 at 15:46
• Seems interdiscipline. I had suggestion already to move here. It has received positive vote here, I think would be better to have closed on physics, myself, if in fact either should really be closed. Jan 3, 2019 at 15:51
• It seems physicist and astronomer use true anomaly for different purpose, say understanding gravity, or viewing a nebula. Perhaps one uses reference to aphelion and one to perhelion? I think it isn't completely unreasonable to have two questions. Jan 3, 2019 at 15:55
• @DavidHammen while cross-posting on SE is certainly discouraged, it's neither forbidden, nor is it a valid reason for closure. The question is about celestial mechanics, which is without doubt on-topic on our site. I'm therefore voting to leave this question open. Jan 3, 2019 at 21:50

Assume you have managed to calculate $$\sin(f)$$ and $$\cos(f)$$ of the true anomaly $$f$$. Then the true anomaly can be expressed in code as $$f = (\sin(f) > = 0)\arccos\big(\cos(f)\big)\, + \, (\sin(f) < 0) \Big(\, 360^{\circ} - \arccos\big(\cos(f)\big)\,\Big)$$ In this expression the logical operation $$(\sin(f) > = 0)$$ produces as output either $$1$$ or $$0$$ and so does $$(\sin(f) < 0)$$. Also make sure the your $$\arccos$$ function produces output in degrees and not radians, because that's what $$\arccos$$ does mathematically. If it produces radians, then multiply the output by $$\frac{180^{\circ}}{\pi}$$ i.e. $$f = (\sin(f) > = 0)\frac{180^{\circ}}{\pi}\,\arccos\big(\cos(f)\big)\, + \, (\sin(f) < 0) \Big(\, 360^{\circ} - \frac{180^{\circ}}{\pi}\,\arccos\big(\cos(f)\big)\,\Big)$$