|
|
HI
I apologise for this probably very simple question in advance - I have a
range of numbers from .1 to 1
and I want to compress then into the range .6 to 1, I don't want to loose
any numbers or alter the proportional relationship between them just
compress it. so that .1 becomes .6 and 1 stays 1 and all other numbers
change propotionally in betwwen, hope that's clear!
Mick
Post a reply to this message
|
|
|
|
The easiest "trick" to scale numbers in this way is to first scale them to
the range 0-1 and then scale them to the desired range.
So if you have numbers between 0.1 and 1, you first scale them to be
between 0 and 1: normalized=(number-0.1)/(1-0.1)
Now you scale this to the range 0.6-1: normalized*(1-0.6)+0.6
If we write that into one line, it would be:
(number-0.1)*(1-0.6)/(1-0.1) + 0.6
and simplifying a bit:
(number-0.1)*0.4/0.9 + 0.6
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
|