def normal_shock_stag_pressure_ratio(M, *args):
    """Gives the normal shock stagnation pressure ratio as a function of upstream Mach number."""

    gamma = args[0]
    a = (0.5*(gamma+1.0)*M)**2.0
    b = a/(1.0+0.5*(gamma-1.0)*M**2.0)
    c = b**(gamma/(gamma-1.0))
    d = 2.0/((gamma+1.0)*(gamma*M**2-0.5*(gamma-1.0))**(1/(gamma-1.0)))*c

    return d