Formula:

e = (1 + (2EJ2) / (mα2))12

Where,

e = Eccentricity

E = Energy

J = Angular Momentum

m = Orbiting Mass

α = GMm (Gravitation)