View Single Post
Unread 15 Aug 2006, 13:36   #2
meglamaniac
Born Sinful
 
meglamaniac's Avatar
 
Join Date: Nov 2000
Location: Loughborough, UK
Posts: 4,059
meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: Really Basic Maths

Ok, I've worked this out from scratch (couldn't remember enough about how to do it) so it could be wrong. But I don't think it is. In GCSE terminology what you're trying to do is a "slide" operation (move numbers to a different section of the number line) and a "scale" operation (adjust the range of a group of numbers on the number line). I'm not sure what the real term is but it probably classes as normalisation.

Anyway:

Find the range

range = 0.433665296 (1.248544456 - 0.81487916)

range needs to = 9 (5 - -4)


Find the scale factor

9 / 0.433665296 = 20.753332311838944105870994113396


proof:

oldRange * SF = newRange

0.433665296 * 20.753332311838944105870994113396 = 9

Let's call the scale factor x


Testing the scale factor

0.81487916 * x = 16.911458001472176828279106751489

1.248544456 * x = 25.911458001472176828279106751489

25.911458001472176828279106751489 - 16.911458001472176828279106751489 = 9.0000000000000000000000000000088

Near enough. Error is due to internal floating point rounding (I've been using Windows Calculator. It's not the best.)


Finally

Let's get our "slide" factor, y.
y = lowest scaled value + 4
y = 16.911458001472176828279106751489 + 4 = 20.91145800147217682827910675148


m = (n * x) - y

where
n is the input unnormalised value and
m is the output normalised value




Also I just realised that form looks familiar.

y = mx + c

The parametric straight line formula.
Which, of course, makes sense. Yes I know it's a minus not a positive in the one we ended up with, but that could just as easily be the case with this formula if c was a negative value. If that doesn't make sense to you, imagine our forumula as m = nx + y instead, then make the value of our slide factor, y, negative. It would produce exactly the same results.

Reassigned values for the straight line forumula:
y is the normalised output.
x is the original input.
m, the gradient, is the scale factor.
c, the constant, is the slide factor (y in the formula we ended up with above).

Plug your numbers into this and you can get a pretty graph of where any scaled number will end up.
__________________
Worth dying for. Worth killing for. Worth going to hell for. Amen.

Last edited by meglamaniac; 15 Aug 2006 at 13:47.
meglamaniac is offline   Reply With Quote