import math


def dew_point(T, RH=None):
    """
    Given the relative humidity and the dry bulb (actual) temperature,
    calculates the dew point (one-minute average).

    The constants a and b are dimensionless, c and d are in degrees
    celsius.

    Using the equation from:
         Buck, A. L. (1981), "New equations for computing vapor pressure
         and enhancement factor", J. Appl. Meteorol. 20: 1527-1532
    """
    if RH is None:
        return "0.0"

    d = 234.5

    if T > 0:
        # Use the set of constants for 0 <= T <= 50 for <= 0.05% accuracy.
        b = 17.368
        c = 238.88
    else:
        # Use the set of constants for -40 <= T <= 0 for <= 0.06% accuracy.
        b = 17.966
        c = 247.15

    gamma = math.log(RH / 100 * math.exp((b - (T / d)) * (T / (c + T))))
    return "%.2f" % ((c * gamma) / (b - gamma))