On this page
numpy.polynomial.polyutils.mapparms
- polynomial.polyutils.mapparms(old, new)[source]
-
Linear map parameters between domains.
Return the parameters of the linear map
offset + scale*xthat mapsoldtonewsuch thatold[i] -> new[i],i = 0, 1.- Parameters
-
- old, newarray_like
-
Domains. Each domain must (successfully) convert to a 1-d array containing precisely two values.
- Returns
-
- offset, scalescalars
-
The map
L(x) = offset + scale*xmaps the first domain to the second.
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.polynomial import polyutils as pu >>> pu.mapparms((-1,1),(-1,1)) (0.0, 1.0) >>> pu.mapparms((1,-1),(-1,1)) (-0.0, -1.0) >>> i = complex(0,1) >>> pu.mapparms((-i,-1),(1,i)) ((1+1j), (1-0j))
© 2005–2022 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.23/reference/generated/numpy.polynomial.polyutils.mapparms.html