-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOrbits.py
48 lines (28 loc) · 880 Bytes
/
Orbits.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import math
def calculate():
G = 6.67 * math.pow(10,-11)
m_earth = 5.97* math.pow(10,24)
spery = 3.15 * math.pow(10,7)
m = m_earth
r = input("Input the distance from the sun in AU (semimajor axis)")
print r
# print math.pow(r, .333333333)
# print math.sqrt(math.pow(r, .333333333333333333))
# rkm = r * 149597870700 #convert AU to m
# try:
# m = input("Input the mass (hit enter for Earth mass)")
# except:
# m = m_earth
# v_earth = math.sqrt(G*m_earth/rkm)
# orbitalvelocity = math.sqrt(G*m/r)
# orbitalvelocityratio = orbitalvelocity/v_earth
period = math.sqrt(math.pow(r, .333333333333333333))
print "The orbital period (years): "
print period
calculate()
#print "The orbital velocity (m/s): "
#print orbitalvelocity
#print "the orbital velocity in relation to earth: "
#print orbitalvelocityratio
if __name__ == "__main__":
calculate()