import math


def calculate_tc(
    max_flow_length, #units of meters
    mean_slope, # percent slope
    const_a=0.000325,
    const_b=0.77,
    const_c=-0.385
    ):
    """
    calculate time of concentration (hourly)

    Inputs:
        - max_flow_length: maximum flow length of a catchment area, derived
            from the DEM for the catchment area.
        - mean_slope: average slope, from the DEM *for just the catchment area*. This must be
        percent slope, provided as an integer (e.g., 23, not 0.23)

    Outputs:
        tc_hr: time of concentration (hourly)
    """
    if not mean_slope:
        mean_slope = 0.00001
    return (
        const_a
        * math.pow(max_flow_length, const_b)
        * math.pow((mean_slope / 100), const_c)
    )