2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -1,6 +1,20 @@
Given two [[wp:Interval (mathematics)|ranges]], <math>[a_1,a_2]</math> and <math>[b_1,b_2]</math>; then a value <math>s</math> in range <math>[a_1,a_2]</math> is linearly mapped to a value <math>t</math> in range <math>[b_1,b_2]</math> when:
:<math>t = b_1 + {(s - a_1)(b_2 - b_1) \over (a_2 - a_1)}</math>
Given two [[wp:Interval (mathematics)|ranges]]:
:::* &nbsp; <big><math>[a_1,a_2]</math></big> &nbsp; and
:::* &nbsp; <big><math>[b_1,b_2]</math></big>;
:::* &nbsp; then a value &nbsp; <big><math>s</math></big> &nbsp; in range &nbsp; <big><math>[a_1,a_2]</math></big>
:::* &nbsp; is linearly mapped to a value &nbsp; <big><math>t</math></big> &nbsp; in range &nbsp; <big><math>[b_1,b_2]</math>
</big> &nbsp; where:
<br>
The task is to write a function/subroutine/... that takes two ranges and a real number, and returns the mapping of the real number from the first to the second range. Use this function to map values from the range <code>[0, 10]</code> to the range <code>[-1, 0]</code>.
:::* &nbsp; <big><big><math>t = b_1 + {(s - a_1)(b_2 - b_1) \over (a_2 - a_1)}</math></big></big>
'''Extra credit:''' Show additional idiomatic ways of performing the mapping, using tools available to the language.
;Task:
Write a function/subroutine/... that takes two ranges and a real number, and returns the mapping of the real number from the first to the second range.
Use this function to map values from the range &nbsp; <big><code> [0, 10] </code></big> &nbsp; to the range &nbsp; <big><code> [-1, 0]. </code></big>
;Extra credit:
Show additional idiomatic ways of performing the mapping, using tools available to the language.
<br><br>