def lorentz(v, v0, I, w):
    """
    A lorentz function that takes linewidth at half intensity (w) as a
    parameter.
    :param v: Array of values at which to evaluate distribution.
    :param v0: Center of the distribution.
    :param w: Peak width at half max intensity

    :returns: Distribution evaluated at points in x.
    """
    return I * ((0.5 * w) ** 2 / ((0.5 * w) ** 2 + (v - v0) ** 2))