two different scales need to relate

havey

New member
Joined
Sep 23, 2007
Messages
1
Hi i have two scales, i getting a number (doing computer programming)

say 3.75 and i need to find that number on the other scale. Here are the two scales and how they match up:

scale1: 0-8-15-22-48-60-73-87-100-114-128
scale2: 0-1-2-3-4-5-6-7-8-9-10

so i have a number in scale 1, as mentioned: 3.75

I need to know the number (decimals included) of what that number is on scale1 :?:

In the progam i'm creating I've given a number ranging from 1 to 10, and that number can have a tenth decimal placing with it.

So i need to conver it to scale 1, i have not found a pattern in scale1 to apply as a general formula, so i'm doing this the long way :cry:

i trying to find formulas for each sub range of scale2, sub range meaning 0 to 1 formula, 1 to 2 formula, 2 to 3 formula, etc.

I someone does find a pattern in the scale1, Wow on then, they are truly smarty pants!

What i'm doing so far:
For the direct relation its easy (0=0,1=8,2=15,etc..)
For the not direct realtion i getting the math floor of that value (rounding down) then i know what forumula to use to convert it over to scale1. So far i have:
if number between 0-1 times it by 8.
between 1 and 2, times by 8 and minus (the decimals places of the given number)

so far i have a forumla for number that range from 0 to 1 and number that range from 1 to 2. I'm stuck on numbers that range from 2 to 3, 3 to 4, 4-5, 5-6, and 6 to 7.

I would really appreciate if someone could either point me in a simplier direction on the wholescale matching or on the indiviual formulas to match the two scales.

Thanks!
 
That's all somewhat hard to follow, Havey;
since 3 = 22, why can't you simply transform 3.75 this way: 22 / 3 * 3.75 = 27.5 ?

OR are you trying to let the fraction (.75) dictate the proportion of the difference
between 22 and 48: .75 * (48 - 22) = .75 * 26 = 19.5; so 3.75 converted = 22 + 19.5 = 41.5 ?

I think you mean the 2nd one; if so:
place your scale 2 amounts in a size 10 Array (no need for the 0) :
A(1) =8, A(2)=15, A(3)=22, A(4)=48, ...., A(10)=128

Let k = number to be converted (example: 3.75)
Get integer portion of number to be converted: i = INT(k) = INT(3.75) = 3

Get the two scale 2 corresponding amounts:
x = A(i) = 22, y = A(i+1) = 48

Convert k to scale 2:
x + (y - x)*(k - i)
= 22 + (48 - 22)*(3.75 - 3)
= 22 + 26*.75
= 22 + 19.5
= 41.5

Would look like this in the Basic computer language (c = converted k):

DATA 8,15,22,48,60,73,87,100,114,128
DIM A(10)
FOR j = 1 to 10 : READ A(j) : NEXT j
INPUT k
i = INT(k)
x = A(i)
y = A(i + 1)
c = x + (y - x)*(k - i)
PRINT c
 
Top