Absmag

Calculate absolute magnitude from visual magnitude and radial distance in light-years
import math import sys Mvis = float(sys.argv[1]) Dist = float(sys.argv[2]) Vabs = Mvis - 5 * (math.log10(Dist / 3.2616) -1) print round(Vabs,3)
 * 1) !/usr/bin/python