def calculate_curvature(fit, yeval, ym_per_pix):
    """
    Calculate the curvature of the road given a fit to one
    of the lane lines
    """
    # Get the parameters of the fit
    A = fit[0]
    B = fit[1]
    # calculate the curvature
    curv = (1+(2*A*yeval*ym_per_pix+B)**2)**1.5/abs(2*A)

    return curv