radius function

double radius(
  1. double eAnom,
  2. double e,
  3. double a
)

Radius distance from eccentric anomaly eAnom, eccentricity e, and semimajor axis a.

Result unit matches a (typically AU).

Implementation

double radius(double eAnom, double e, double a) {
  return a * (1 - e * math.cos(eAnom));
}