I cant get around on how to express this is PHP.
I have 100 and 420 as my min and max value that I wish to obtain.
Than lets suppose I have:
1000
4534
34566
123145
12312265
Now, how can I say:
Take 4534 and knowing that 1000 = 420 and 12312265 = 100 determine 4534 value.
To make it more clear, Im trying to represent web page ranks with squares, so if the rank is 1 it should be translated into my maximum value/size 420, however if the page ranks low on popularity, say 13000 then its size should be close to the minimum 100. I know all the values.
Thank you.
Im still having trouble figuring this out.
So far using the code from the first answer I have:
$srcmin=1185;
$srcmax=25791525;
$destmin=100;
$destmax=420;
$pos = (($RANK - $srcmin) / ($srcmax-$srcmin)) ;
$rescaled = ($pos * ($destmax-$destmin)) + $destmin;*/
$percentage = (($RANK - $MIN) * 100) / $MAX;
$SIZE = (($percentage / 320) * 100) + 100
Being $RANK my values for the ranks of web pages and $SIZE the value that I need to size them accordingly. This does not work (my mistake no doubt) all I get from $SIZE is 100.