anomalyDistance function
True anomaly and distance for a body in a parabolic orbit.
timeP is time of perihelion (JDE), pDis is perihelion distance (AU).
Returns (nu, r) where nu is true anomaly in radians and r is distance in AU.
Implementation
({double nu, double r}) anomalyDistance(double jde, double timeP, double pDis) {
final w = 3 * k / math.sqrt2 * (jde - timeP) / pDis / math.sqrt(pDis);
final g = w * 0.5;
final y = _cbrt(g + math.sqrt(g * g + 1));
final s = y - 1 / y;
return (nu: 2 * math.atan(s), r: pDis * (1 + s * s));
}