Advertisement

Need help finding an equation

Started by August 26, 2003 05:04 PM
3 comments, last by RobertC 21 years, 5 months ago
This is probably staring me right in the face but anyway, what I would like is a function that takes a number (between 0.0 and 1.0) and returns 1.0 if this number is at 0.5. I can''t explain the rest so I will give you an example: Input|Return .0 0 .1 .2 .2 .4 .3 .6 .4 .8 .5 1.0 .6 .8 .7 .6 etc.. It seems easy, but maths isn''t my strong point . Could this be related to an exponential function of some sort? Or an ease curve? Thanks for your help.
I see a 2, 4, 6, 8 pattern that goes down at 5... so it'd be 1-(0.2)|x-0.5|. I think...

EDIT: Missed decimals...


[edited by - cowsarenotevil on August 26, 2003 6:12:01 PM]
-~-The Cow of Darkness-~-
Advertisement
1 - 2*abs(x - 0.5)
quote:
Original post by Brother Bob
1 - 2*abs(x - 0.5)  



That's the same as mine...

EDIT: Except that 2 should be 0.2...

[edited by - cowsarenotevil on August 26, 2003 6:12:22 PM]
-~-The Cow of Darkness-~-
Thanks for the quick replies, yes that is what I am looking for

This topic is closed to new replies.

Advertisement