Skip to main content

Your scaling will need to take into account the possible range of the original number. There is a difference if your 200 could have been in the range [200,201] or in [0,200] or in [0,10000].

So let

  • $r_{\text{min}}$ denote the minimum of the range of your measurement
  • $r_{\text{max}}$ denote the minimummaximum of the range of your measurement
  • $t_{\text{min}}$ denote the minimum of the range of your desired target scaling
  • $t_{\text{max}}$ denote the minimummaximum of the range of your desired target scaling
  • $m\in[r_{\text{min}},r_{\text{max}}]$ denote your measurement to be scaled

Then

$$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}}\times (t_{\text{max}}-t_{\text{min}}) + t_{\text{min}}$$

will scale $m$ linearly into $[t_{\text{min}},t_{\text{max}}]$ as desired.

To go step by step,

  1. $ m\mapsto m-r_{\text{min}}$ maps $m$ to $[0,r_{\text{max}}-r_{\text{min}}]$.
  2. Next, $$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}} $$

maps $m$ to the interval $[0,1]$, with $m=r_{\text{min}}$ mapped to $0$ and $m=r_{\text{max}}$ mapped to $1$.

  1. Multiplying this by $(t_{\text{max}}-t_{\text{min}})$ maps $m$ to $[0,t_{\text{max}}-t_{\text{min}}]$.

  2. Finally, adding $t_{\text{min}}$ shifts everything and maps $m$ to $[t_{\text{min}},t_{\text{max}}]$ as desired.

Your scaling will need to take into account the possible range of the original number. There is a difference if your 200 could have been in the range [200,201] or in [0,200] or in [0,10000].

So let

  • $r_{\text{min}}$ denote the minimum of the range of your measurement
  • $r_{\text{max}}$ denote the minimum of the range of your measurement
  • $t_{\text{min}}$ denote the minimum of the range of your desired target scaling
  • $t_{\text{max}}$ denote the minimum of the range of your desired target scaling
  • $m\in[r_{\text{min}},r_{\text{max}}]$ denote your measurement to be scaled

Then

$$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}}\times (t_{\text{max}}-t_{\text{min}}) + t_{\text{min}}$$

will scale $m$ linearly into $[t_{\text{min}},t_{\text{max}}]$ as desired.

To go step by step,

  1. $ m\mapsto m-r_{\text{min}}$ maps $m$ to $[0,r_{\text{max}}-r_{\text{min}}]$.
  2. Next, $$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}} $$

maps $m$ to the interval $[0,1]$, with $m=r_{\text{min}}$ mapped to $0$ and $m=r_{\text{max}}$ mapped to $1$.

  1. Multiplying this by $(t_{\text{max}}-t_{\text{min}})$ maps $m$ to $[0,t_{\text{max}}-t_{\text{min}}]$.

  2. Finally, adding $t_{\text{min}}$ shifts everything and maps $m$ to $[t_{\text{min}},t_{\text{max}}]$ as desired.

Your scaling will need to take into account the possible range of the original number. There is a difference if your 200 could have been in the range [200,201] or in [0,200] or in [0,10000].

So let

  • $r_{\text{min}}$ denote the minimum of the range of your measurement
  • $r_{\text{max}}$ denote the maximum of the range of your measurement
  • $t_{\text{min}}$ denote the minimum of the range of your desired target scaling
  • $t_{\text{max}}$ denote the maximum of the range of your desired target scaling
  • $m\in[r_{\text{min}},r_{\text{max}}]$ denote your measurement to be scaled

Then

$$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}}\times (t_{\text{max}}-t_{\text{min}}) + t_{\text{min}}$$

will scale $m$ linearly into $[t_{\text{min}},t_{\text{max}}]$ as desired.

To go step by step,

  1. $ m\mapsto m-r_{\text{min}}$ maps $m$ to $[0,r_{\text{max}}-r_{\text{min}}]$.
  2. Next, $$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}} $$

maps $m$ to the interval $[0,1]$, with $m=r_{\text{min}}$ mapped to $0$ and $m=r_{\text{max}}$ mapped to $1$.

  1. Multiplying this by $(t_{\text{max}}-t_{\text{min}})$ maps $m$ to $[0,t_{\text{max}}-t_{\text{min}}]$.

  2. Finally, adding $t_{\text{min}}$ shifts everything and maps $m$ to $[t_{\text{min}},t_{\text{max}}]$ as desired.

added 104 characters in body
Source Link
Stephan Kolassa
  • 130.7k
  • 22
  • 264
  • 497

Your scaling will need to take into account the possible range of the original number. There is a difference if your 200 could have been in the range [200,201] or in [0,200] or in [0,10000].

So let

  • $r_{\text{min}}$ denote the minimum of the range of your measurement
  • $r_{\text{max}}$ denote the minimum of the range of your measurement
  • $t_{\text{min}}$ denote the minimum of the range of your desired target scaling
  • $t_{\text{max}}$ denote the minimum of the range of your desired target scaling
  • $m\in[r_{\text{min}},r_{\text{max}}]$ denote your measurement to be scaled

Then

$$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}}\times (t_{\text{max}}-t_{\text{min}}) + t_{\text{min}}$$

will scale $m$ linearly into $[t_{\text{min}},t_{\text{max}}]$ as desired.

To go step by step,

$$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}} $$

  1. $ m\mapsto m-r_{\text{min}}$ maps $m$ to $[0,r_{\text{max}}-r_{\text{min}}]$.
  2. Next, $$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}} $$

maps $m$ to the interval $[0,1]$, with $m=r_{\text{min}}$ mapped to $0$ and $m=r_{\text{max}}$ mapped to $1$.

Multiplying this by $(t_{\text{max}}-t_{\text{min}})$ maps $m$ to $[0,t_{\text{max}}-t_{\text{min}}]$.

Finally, adding $t_{\text{min}}$ shifts everything and maps $m$ to $[t_{\text{min}},t_{\text{max}}]$ as desired.

  1. Multiplying this by $(t_{\text{max}}-t_{\text{min}})$ maps $m$ to $[0,t_{\text{max}}-t_{\text{min}}]$.

  2. Finally, adding $t_{\text{min}}$ shifts everything and maps $m$ to $[t_{\text{min}},t_{\text{max}}]$ as desired.

Your scaling will need to take into account the possible range of the original number. There is a difference if your 200 could have been in the range [200,201] or in [0,200] or in [0,10000].

So let

  • $r_{\text{min}}$ denote the minimum of the range of your measurement
  • $r_{\text{max}}$ denote the minimum of the range of your measurement
  • $t_{\text{min}}$ denote the minimum of the range of your desired target scaling
  • $t_{\text{max}}$ denote the minimum of the range of your desired target scaling
  • $m\in[r_{\text{min}},r_{\text{max}}]$ denote your measurement to be scaled

Then

$$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}}\times (t_{\text{max}}-t_{\text{min}}) + t_{\text{min}}$$

will scale $m$ linearly into $[t_{\text{min}},t_{\text{max}}]$ as desired.

To go step by step,

$$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}} $$

maps $m$ to the interval $[0,1]$, with $m=r_{\text{min}}$ mapped to $0$ and $m=r_{\text{max}}$ mapped to $1$.

Multiplying this by $(t_{\text{max}}-t_{\text{min}})$ maps $m$ to $[0,t_{\text{max}}-t_{\text{min}}]$.

Finally, adding $t_{\text{min}}$ shifts everything and maps $m$ to $[t_{\text{min}},t_{\text{max}}]$ as desired.

Your scaling will need to take into account the possible range of the original number. There is a difference if your 200 could have been in the range [200,201] or in [0,200] or in [0,10000].

So let

  • $r_{\text{min}}$ denote the minimum of the range of your measurement
  • $r_{\text{max}}$ denote the minimum of the range of your measurement
  • $t_{\text{min}}$ denote the minimum of the range of your desired target scaling
  • $t_{\text{max}}$ denote the minimum of the range of your desired target scaling
  • $m\in[r_{\text{min}},r_{\text{max}}]$ denote your measurement to be scaled

Then

$$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}}\times (t_{\text{max}}-t_{\text{min}}) + t_{\text{min}}$$

will scale $m$ linearly into $[t_{\text{min}},t_{\text{max}}]$ as desired.

To go step by step,

  1. $ m\mapsto m-r_{\text{min}}$ maps $m$ to $[0,r_{\text{max}}-r_{\text{min}}]$.
  2. Next, $$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}} $$

maps $m$ to the interval $[0,1]$, with $m=r_{\text{min}}$ mapped to $0$ and $m=r_{\text{max}}$ mapped to $1$.

  1. Multiplying this by $(t_{\text{max}}-t_{\text{min}})$ maps $m$ to $[0,t_{\text{max}}-t_{\text{min}}]$.

  2. Finally, adding $t_{\text{min}}$ shifts everything and maps $m$ to $[t_{\text{min}},t_{\text{max}}]$ as desired.

Source Link
Stephan Kolassa
  • 130.7k
  • 22
  • 264
  • 497

Your scaling will need to take into account the possible range of the original number. There is a difference if your 200 could have been in the range [200,201] or in [0,200] or in [0,10000].

So let

  • $r_{\text{min}}$ denote the minimum of the range of your measurement
  • $r_{\text{max}}$ denote the minimum of the range of your measurement
  • $t_{\text{min}}$ denote the minimum of the range of your desired target scaling
  • $t_{\text{max}}$ denote the minimum of the range of your desired target scaling
  • $m\in[r_{\text{min}},r_{\text{max}}]$ denote your measurement to be scaled

Then

$$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}}\times (t_{\text{max}}-t_{\text{min}}) + t_{\text{min}}$$

will scale $m$ linearly into $[t_{\text{min}},t_{\text{max}}]$ as desired.

To go step by step,

$$ m\mapsto \frac{m-r_{\text{min}}}{r_{\text{max}}-r_{\text{min}}} $$

maps $m$ to the interval $[0,1]$, with $m=r_{\text{min}}$ mapped to $0$ and $m=r_{\text{max}}$ mapped to $1$.

Multiplying this by $(t_{\text{max}}-t_{\text{min}})$ maps $m$ to $[0,t_{\text{max}}-t_{\text{min}}]$.

Finally, adding $t_{\text{min}}$ shifts everything and maps $m$ to $[t_{\text{min}},t_{\text{max}}]$ as desired.