The semimajor axis of an ellipse (e.g. a planetary orbit) is 1/2 the length of the major axis which is a segment of a line passing thru the foci of the ellipse with endpoints on the ellipse itself. The semimajor axis of a planetary orbit is also the average distance from the planet to its primary. The periapsis and apoapsis distances can be calculated from the semimajor axis and the eccentricity by