Rescale
Details
- Rescale[x,{min,max}] is effectively equivalent to (x-min)/(max-min).
- For exact numeric quantities, Rescale internally uses numerical approximations to establish its result. This process can be affected by the setting of the global variable $MaxExtraPrecision.
- Rescale works with complex numbers and symbolic quantities.
Examples
open all close allBasic Examples (3)
Rescale to run from 0 to 1 over the range
to 10:
Rescale[2.5, {-10, 10}]Rescale[12.5, {-10, 10}]Rescale so that all the list elements run from 0 to 1:
Rescale[{-.7, .5, 1.2, 5.6, 1.8}]Plot over a subset of the reals:
Plot[Rescale[x, {-2, 2}], {x, -3, 3}]Scope (24)
Numerical Evaluation (5)
Rescale[-3 / 2, {-2, 2}]Rescale[Pi, {0, 2.5}]Rescale[3, {-9, 7}, {11, 28}]Rescale[1 + 2I, {0, 5}]Rescale[1 + 2I, {0, 1 + I}]N[Rescale[1 / 11, {1 / 7, 5}], 50]The precision of the output tracks the precision of the input:
Rescale[8, {-9, 7.111111111111111111111}]Evaluate efficiently at high precision:
N[Rescale[1 / 8, {1 / 17, 1 / 11}], 100]//TimingN[Rescale[91 / 1131, {92 / 173, 72 / 531 }], 10^8];//TimingRescale threads over lists in its first argument:
Rescale[{-2, 0, 2}]Specify the maximum and minimum values:
Rescale[{-2, 0, 2}, {-5, 5}]Rescale[{-2, 0, 2}, {-5, 5}, {-1, 1}]Specific Values (6)
Rescale[0, {a, b}]Rescale[0, {a, b}, {c, d}]Rescale[a, {a, b}]Rescale[a, {b, a}]Rescale x to run from
to
when its values run from
to
:
Rescale[x, {a, b}, {c, d}]Value with a degenerate third argument:
Rescale[x, {a, b}, {c, c}]//SimplifyRescale a list with symbolic quantities:
Rescale[{1, 2, 3, 4, 5, 6}, {0, a}]Find a value of x for which the Rescale[x,{-2,2}]=1:
xval = x /. FindRoot[Rescale[x, {-2, 2}] == 1, {x, 1.5}]Plot[Rescale[x, {-2, 2}], {x, -5, 5}, Epilog -> Style[Point[{xval, Rescale[xval, {-2, 2}]}], PointSize[Large], Red]]Visualization (3)
Visualize two Rescale expressions with reversed endpoints in the second argument:
Plot[{Rescale[x, {0, 2}], Rescale[x, {2, 0}]}, {x, -5, 5}, PlotLegends -> "Expressions"]Visualize two Rescale expressions with reversed endpoints in the third argument:
Plot[{Rescale[x, {0, 2}, {3, 5}], Rescale[x, {0, 2}, {5, 3}]}, {x, -5, 5}, PlotLegends -> "Expressions"]Visualize Rescale in the complex plane:
ComplexPlot3D[Rescale[x, {1 + I, 2 + 2I}], {x, 3}]Function Properties (4)
Rescale is defined for all real and complex inputs in its first argument:
FunctionDomain[Rescale[x, {a, b}], x]FunctionDomain[Rescale[x, {a, b}, {c, d}], x, Complexes]The domain of the endpoints in the second and third arguments:
FunctionDomain[Rescale[x, {a, b}, {c, d}], {a, b, c, d}]The only restriction is that endpoints in the second argument must be distinct:
FunctionDomain[Rescale[x, {a, b}, {c, d}], {a, b, c, d}, Complexes]Rescale achieves all real and complex values:
FunctionRange[Rescale[x, {0, 1}, {2, 3}], x, y]FunctionRange[Rescale[x, {0, 1}, {2, 3}], x, y, Complexes]The one-argument form for a list can be expressed using Min and Max:
data = RandomReal[1, 10];Rescale[list] is effectively Rescale[list,{Min[list],Max[list]}]:
Rescale[data] == Rescale[data, {Min[data], Max[data]}]Differentiation and Integration (6)
First derivative with respect to x:
D[Rescale[x, {a, b}], x]//SimplifyFirst and second derivatives with respect to x:
Table[D[Rescale[x, {-a, b}, {c, d}], {x, k}], {k, 1, 2}]Formula for the ![]()
derivative with respect to x:
D[Rescale[x, {a, b}], {x, k}]// PiecewiseExpandFirst derivative with respect to an endpoint:
D[Rescale[x, {a, b}, {c, d}], a]//SimplifyCompute the indefinite integral using Integrate:
Integrate[Rescale[x, {a, b}], x]FullSimplify[D[%, x] == Rescale[x, {a, b}]]Integrate[Rescale[x, {a, b}], {x, 0, 3}]Applications (1)
Properties & Relations (3)
In the complex plane, Rescale just scales and rotates a region:
ParametricPlot[{Re[#], Im[#]}&[Rescale[x + I y, {1 + I, 3 - 2I}]], {x, -1, 1}, {y, -1, 1}]Reversing both range specifications gives back the same result:
Rescale[x, {Subscript[r, 0], Subscript[r, 1]}, {Subscript[x, 0], Subscript[x, 1]}]//SimplifyRescale[x, {Subscript[r, 1], Subscript[r, 0]}, {Subscript[x, 1], Subscript[x, 0]}]//SimplifyRescale is effectively linear with respect to its first argument:
Rescale[α x + (1 - α) y, {a, b}, {c, d}]α Rescale[x, {a, b}, {c, d}] + (1 - α) Rescale[y, {a, b}, {c, d}]Simplify[% == %%]See Also
Mean Clip Scaled RescalingTransform Normalize Standardize
Function Repository: BiasedRescale GainRescale
Tech Notes
Related Guides
History
Introduced in 2004 (5.1)
Text
Wolfram Research (2004), Rescale, Wolfram Language function, https://reference.wolfram.com/language/ref/Rescale.html.
CMS
Wolfram Language. 2004. "Rescale." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Rescale.html.
APA
Wolfram Language. (2004). Rescale. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Rescale.html
BibTeX
@misc{reference.wolfram_2026_rescale, author="Wolfram Research", title="{Rescale}", year="2004", howpublished="\url{https://reference.wolfram.com/language/ref/Rescale.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_rescale, organization={Wolfram Research}, title={Rescale}, year={2004}, url={https://reference.wolfram.com/language/ref/Rescale.html}, note=[Accessed: 12-June-2026]}