Last active
December 10, 2015 18:28
-
-
Save anupamsharma/4474695 to your computer and use it in GitHub Desktop.
Astronomy Course RA course formulas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
AU_METER = 1.49597870691e11 #MS | |
AU_KM = 1.49597870691e8 | |
SEC = 1 | |
MIN = SEC * 60 | |
HOUR = MIN * 60 | |
DAY = 24 * HOUR | |
YEAR = DAY * 365 | |
G = 6.673e-11 | |
M_EARTH = 5.97219e24 | |
R_EARTH = 6.371e6 # In M/S | |
M_SUN = 1.9891e30 | |
R_SUN = 6.95508e8 # In M/S | |
def parallax_distance_au(angle_in_arcseconds): | |
""" | |
>> parallax_distance_au(0.742) | |
277985.17520215636 | |
""" | |
return 206265 / angle_in_arcseconds | |
def parallax_distance_parsec(angle_in_arcseconds): | |
""" | |
>> parallax_distance_au(0.742) | |
1.3477088948787062 | |
""" | |
return (1 / angle_in_arcseconds) | |
def parallax_distance_arc_length_au(distance_parsec, angle_in_arcseconds): | |
return angle_in_arcseconds * distance_parsec | |
def escape_velocity(m, r): | |
return math.sqrt((2.0 * G * float(m)) / float(r)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment