def mapparms(old, new) :
    """Linear map between domains.

    Return the parameters of the linear map ``off + scl*x`` that maps the
    `old` domain to the `new` domain. The map is defined by the requirement
    that the left end of the old domain map to the left end of the new
    domain, and similarly for the right ends.

    Parameters
    ----------
    old, new : array_like
        The two domains should convert as 1D arrays containing two values.

    Returns
    -------
    off, scl : scalars
        The map `=``off + scl*x`` maps the first domain to the second.

    See Also
    --------
    getdomain, mapdomain

    """
    oldlen = old[1] - old[0]
    newlen = new[1] - new[0]
    off = (old[1]*new[0] - old[0]*new[1])/oldlen
    scl = newlen/oldlen
    return off, scl