Skip to content

Instantly share code, notes, and snippets.

Created February 14, 2013 02:04
Show Gist options
  • Save anonymous/4950095 to your computer and use it in GitHub Desktop.
Save anonymous/4950095 to your computer and use it in GitHub Desktop.
Kepler's Laws
print ("This program will find Mass(kg), Radius(m) or Time(s) via Kepler's law's")
print ("Enter x for the unknown value")
m = (input("Mass: "))
r = (input("Radius: "))
t = (input("Time: "))
x = ("unknown")
if m == x:
m = ((4*3.14*r**3)/(.0000000000667*t**2))
print ("m=")
elif r == x:
r = ((t**2*.0000000000667*m)/(4*3.14*r**2))**(1/3)
print ("r=")
elif t == x:
t = ((4*3.14**2*r**3)/(.0000000000667*m))**(.5)
print ("t=")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment