for example i have two ranges
(1) 0 to 3 (2) 10 to 15
in the range (1) I have numbers from 0 to 3, where 0 is the minimum, and 3 is the maximum value ... (it also has the values 1 and 2) ...
now I wanted to rescale both ranges (1) and (2) to a range from 0 to 1. Can you show me how to do this or at least point to useful sites? thanks a lot!
What you describe is called linear interpolation .
, c a b, x 0 1, c a b. x :
c
a
b
x
x := (c - a) / (b - a)
, 10 15 (, 11), 0 1, :
x := (11 - 10) / (15 - 10) x := 1/5
, 11 10 15.
( c a b x y z), x
y
z
x := (c - a) * (z - y) / (b - a) + y
z = 1 y = 0.
z = 1
y = 0
Source: https://habr.com/ru/post/1718211/More articles:JMS CreateQueue Question - javaForm field designation - cssApache Forrest как решение для документирования кода - javaHow to get visio to re-evaluate formulas when opening a document with an unreliable visio - xmlПочему кеш-ресурс Rails не работает для JS в промежуточной среде? - javascriptFlymake not working for me on windows emacs - windowsBuilt-in tree view for Django-admin sites? - pythonBuilding a multi-parameter MySQL search query - mysqlWhat does splat do here? - ruby | fooobar.comHow to create simple 2D NURBS using XAML? - .netAll Articles