import math


def lorentzian(x, cen=0, gamma=1, peak=None):
    """1 dimensional Lorentzian

    Parameters
    ----------
    x     : array
    cen   : [0] center, x0
    gamma : [1] half width at half maximum
    peak  : [None] if None, peak = 1 / (math.pi*sigma), the distribution integrate to 1
    """
    if peak is None:
        peak = 1.0 / (math.pi * gamma)
    return peak * (1.0 / (1.0 + ((1.0 * x - cen) / gamma) ** 2))