def find_ellipse r1 phi1 r2 phi2 mu 67428e-11 6e 24 mu r1 cos phi1 r1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
def find_ellipse(r1, phi1, r2, phi2):
mu = 6.67428e-11 * 6e+24
a = mu * r1
b = cos(phi1) * r1 * mu
c = mu * r2
d = cos(phi2) * r2 * mu
h1 = sqrt((a*d-c*b)/(d-b))
h2 = -sqrt((a*d-c*b)/(d-b))
e = (h1*h1-a)/b
return h1, e