<p>Assuming you want a linear transformation (which is what &quot;without the curve changing&quot; sounds like to me), to rescale from range <strong>c..d</strong> to range <strong>0..1</strong> subtract the minimum then divide by the difference, i.e.</p>
<p><span class="math-container">$val_t = (val - c) / (d-c)$</span></p>
<p>The inverse of this can be applied to work the other way, i.e.</p>
<p><span class="math-container">$inp_t = val \times (b-a) + a$</span></p>
<p>For a function <span class="math-container">$f(x)$</span>, with ranges as you have stated, the full transformation of input and output would be:</p>
<p><span class="math-container">$g(x_t) = \frac{f(x_t \times (b-a) + a) - c}{d-c}$</span></p>

CC BY-SA 4.0
2022-02-06T14:05:43.723Z
Very cool response
M__
CC BY-SA 4.0
2022-02-05T23:41:10.617Z
2022-02-07T04:39:48.050Z
2022-02-07T04:39:48.050Z
gringer
<p>When we have a function which takes values ​​in [a,b] and which returns values ​​in [c,d], what transformation can we do so that the function takes values ​​in [0,1] and returns values ​​in [0,1] without the curve changing in both cases?</p>

CC BY-SA 4.0
2022-02-04T17:04:04.880Z
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
Community
CC BY-SA 4.0
2022-02-05T10:26:00.433Z
Please provide a concrete example that doesn't involve something like "function(x) return x;", which is what you're implying.
Devon Ryan
<sequence-analysis>
How to rescale a function?
# How to rescale a function?

(Asked by: username_0 on 2022-02-04)

When we have a function which takes values ​​in [a,b] and which returns values ​​in [c,d], what transformation can we do so that the function takes values ​​in [0,1] and returns values ​​in [0,1] without the curve changing in both cases?

**Tags:** sequence-analysis
> **Comments:**
> **username_1**: Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.  
> **username_2**: Please provide a concrete example that doesn't involve something like "function(x) return x;", which is what you're implying.  

---

## 1 answers

### Answer by username_3 on 2022-02-05. Score: 2

Assuming you want a linear transformation (which is what "without the curve changing" sounds like to me), to rescale from range **c..d** to range **0..1** subtract the minimum then divide by the difference, i.e.

$val\_t = (val - c) / (d-c)$

The inverse of this can be applied to work the other way, i.e.

$inp\_t = val \times (b-a) + a$

For a function $f(x)$, with ranges as you have stated, the full transformation of input and output would be:

$g(x\_t) = \frac{f(x\_t \times (b-a) + a) - c}{d-c}$

> **Comments:**
> **username_4**: Very cool response  

---

