From eb344152c11a6e0cd7b7427d584ada53aa9224e1 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Sun, 4 Dec 2022 17:00:54 -0500 Subject: [PATCH] Fixed it so true anomaly is put on the range 0..2pi --- src/orbel/orbel.f90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/orbel/orbel.f90 b/src/orbel/orbel.f90 index 9e7a571eb..0a4416160 100644 --- a/src/orbel/orbel.f90 +++ b/src/orbel/orbel.f90 @@ -1037,6 +1037,7 @@ pure module subroutine orbel_xv2el(mu, px, py, pz, vx, vy, vz, a, e, inc, capom, rdot = sign(sqrt(v2 - (h / r)**2),rdotv) sf = a * (1.0_DP - e**2) / (h * e) * rdot f = atan2(sf,cf) + if (f < 0.0_DP) f = f + TWOPI else f = u end if