#Calculate the orbital period and the speed of a satellite in oribt around
#a massive object of mass M at a distance r from the centre of mass M.
#pi
pi = 3.14159
#gravitational constant in mks units
G = 6.67300e-11 # m3 kg-1 s-2
#get r
r = input('Enter radius r in metres and press return. ')
#get M
M = input('Enter mass M in kilograms and press return. ')
#This is the period in seconds
T=((4*pi**2)*r**3/(G*M))**0.5
#The period in years is T divided by the number of seconds in a year.
T_years = T/(365.0*24.0*60.0*60.0)
#The speed for a circular orbit of radius r
v = 2*pi*r/T
print 'You set M = ', M, 'kg and r = ', r, 'metres.'
print 'The period is ', T_years,'years and the speed is', v,'m/s.'