Python script for calculating the separation in AU between two stars in a binary system with known masses and period of revolution (the example uses Kruger 60 A/B):
#!/usr/bin/env python3
import math
import sys
m1 = float(sys.argv[1])
m2 = float(sys.argv[2])
P = float(sys.argv[3])
a = ((m1 + m2) * P**2) ** (1/3)
print(f"Total mass : {m1 + m2:.4f} M☉")
print(f"Orbital period : {P:.2f} years")
print(f"Separation : {a:.3f} AU")
