def get_hohmann_delay x1 y1 x2 y2 r1 sqrt x1 y1 r2 sqrt x2 y2 r12 r1 r

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
def get_hohmann_delay(x1, y1, x2, y2):
r1 = sqrt(x1**2 + y1**2)
r2 = sqrt(x2**2 + y2**2)
r12 = r1 + r2
phi0 = atan2(y1, x1)
phi1 = atan2(y2, x2)
#~ uncompensated = pi* sqrt((r12 / 2 / r2) ** 3)
#~ compensate = uncompensated * sqrt(r1**3) / (sqrt(r2**3) - sqrt(r1**3))
#~ return (compensate + uncompensated) * sqrt(r1**3 / mu)
ret = (pi*sqrt((r12/(2*r2))**3)-pi-phi0+phi1)/(1/sqrt((r1**3)/mu)-1/sqrt((r2**3)/mu))
print "t:", ret
return ret