import math


def k_density_coefficient(lat_deg):
    """
    NWS 23 pdf page 50, page 24, figure 2.10, emperical relationship (linear regression)
    This is for the PMH, We can also improve this relationship
    This is what I thought, but apparently not: (1.0/(Rho0_kPa * math.e)) ** (0.5)
    DEP: lat 24, K 68.1; lat 45, K 65
        SPH: (65-68.1)/(45-24) = -0.147619048
        PMH: (66.2 - 70.1)/(45 - 24) = -0.185714286

    :param lat_deg:
    :return: float (kts) K factor for kts, In. Hg
    """

    # return 70.1 + -0.185714286 * (lat_deg - 24.0)
    return 69.1952184 / (1 + math.exp(0.20252 * (lat_deg - 58.72458)))