def mapparms(old, new):
oldlen = old[<NUM_LIT:1>] - old[<NUM_LIT:0>]<EOL>newlen = new[<NUM_LIT:1>] - new[<NUM_LIT:0>]<EOL>off = (old[<NUM_LIT:1>]*new[<NUM_LIT:0>] - old[<NUM_LIT:0>]*new[<NUM_LIT:1>])/oldlen<EOL>scl = newlen/oldlen<EOL>return off, scl<EOL>
Linear map parameters between domains.

Return the parameters of the linear map ``offset + scale*x`` that maps
`old` to `new` such that ``old[i] -> new[i]``, ``i = 0, 1``.

Parameters
----------
old, new : array_like
    Domains. Each domain must (successfully) convert to a 1-d array
    containing precisely two values.

Returns
-------
offset, scale : scalars
    The map ``L(x) = offset + scale*x`` maps the first domain to the
    second.

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

Notes
-----
Also works for complex numbers, and thus can be used to calculate the
parameters required to map any line in the complex plane to any other
line therein.

Examples
--------
>>> from numpy import polynomial as P
>>> P.mapparms((-1,1),(-1,1))
(0.0, 1.0)
>>> P.mapparms((1,-1),(-1,1))
(0.0, -1.0)
>>> i = complex(0,1)
>>> P.mapparms((-i,-1),(1,i))
((1+1j), (1+0j))