Loading binarycpython/utils/useful_funcs.py +6 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,9 @@ YEARDY = 3.651995478818308811241877265275e02 def calc_period_from_sep(M1, M2, sep): """ calculate period from separation args : M1, M2, separation (Rsun) args : M1 (Msol), M2 (Msol), separation (Rsun) returns the period (days) """ return YEARDY * (sep / AURSUN) * math.sqrt(sep / (AURSUN * (M1 + M2))) Loading @@ -31,7 +33,9 @@ def calc_period_from_sep(M1, M2, sep): def calc_sep_from_period(M1, M2, period): """ inverse of the above function args : M1, M2, period (days) args : M1 (Msol), M2 (Msol), period (days) returns the separation (Rsun) """ return AURSUN * (period * period * (M1 + M2) / (YEARDY * YEARDY)) ** (1.0 / 3.0) Loading Loading
binarycpython/utils/useful_funcs.py +6 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,9 @@ YEARDY = 3.651995478818308811241877265275e02 def calc_period_from_sep(M1, M2, sep): """ calculate period from separation args : M1, M2, separation (Rsun) args : M1 (Msol), M2 (Msol), separation (Rsun) returns the period (days) """ return YEARDY * (sep / AURSUN) * math.sqrt(sep / (AURSUN * (M1 + M2))) Loading @@ -31,7 +33,9 @@ def calc_period_from_sep(M1, M2, sep): def calc_sep_from_period(M1, M2, period): """ inverse of the above function args : M1, M2, period (days) args : M1 (Msol), M2 (Msol), period (days) returns the separation (Rsun) """ return AURSUN * (period * period * (M1 + M2) / (YEARDY * YEARDY)) ** (1.0 / 3.0) Loading