Equatorial DN is off
mmomtchev opened this issue · 5 comments
#1587 adds AN/DN to the target orbit info window, which are computed by MechJeb, and it seems that the DN is off.
This image shows Moon's orbit - the target's true longitude is 180° from the AN, but the DN is still 4 days ahead. Also, if you subtract the time to DN from the time to AN, the result should be exactly half the orbital period - and it is not.
(This is issue seems to be independent from #1587)
I think I have found the problem, what is called true anomaly should probably be called true longitude as AFAIK the result of this calculation is the true longitude and not the true anomaly:
MechJeb2/MechJeb2/OrbitExtensions.cs
Line 297 in dc618a2
It computes the direction of the equatorial crossing which is the Unity's up direction?
Shouldn't all calculations involving orbital times use the mean anomaly instead of the true anomaly?
Related to Principia dynamically modifying the orbital period, everything is like it should be in MechJeb
I found the culprit - there are two overloaded functions called TrueAnomalyFromVector
: one in KSP, that returns an angle in radians and another one in MechJeb that returns an angle in degrees. There is even a todo for fixing it 😄
MechJeb2/MechJeb2/OrbitExtensions.cs
Line 378 in dc618a2
The equatorial DN uses the KSP version.
Fixed by #1589