Page 1 of 1

What Equation Would Do This?

Posted: Sat Jul 09, 2011 11:23 pm
by Dakatsu
I've been trying to figure out for an hour an equation that would make a sigmoid shape, and have points at (0,0), (½,½), and (1,1). The range of numbers entered into this formula would only be between 0 and 1, so anything else doesn't matter.

I've toyed with instead converting the number range of 0 to 1 to -1 through 1, and then using x² for numbers above 0 and -(x²) for numbers below 0 and somehow 'resizing' the graph so (-1,-1) would be at (0,0), (0,0) at (½,½), and (1,1) being left alone, but I can't figure out how to do that final step!

Anyone have an idea? I swear I saw this formula/graph before in math class, but I can't figure it out! :(

Edit: I think I actually need that graph flipped and then rotated 90°; I basically need a function where I enter time in, and it speeds up to 0.5, then slows to 1.

Re: What Equation Would Do This?

Posted: Sun Jul 10, 2011 7:35 am
by Burlyman
Oh, that's a logistic function. Try looking up logistic functions and see what you can find out.

Re: What Equation Would Do This?

Posted: Sun Jul 10, 2011 10:35 am
by snoopy
You can do it with a third order equation I think.

[ Post made via Android ] Image

Re: What Equation Would Do This?

Posted: Sun Jul 10, 2011 9:39 pm
by Foil
Snoopy is exactly right.

You know y=x^3 gives you roughly the shape you want in the (-1,1) range, right? Just adjust it a bit to put it exactly where you want it:

y = ((2x-1)^3 + 1) / 2

Easy to verify this hits all the points you want.

Re: What Equation Would Do This?

Posted: Tue Jul 12, 2011 5:48 pm
by Dakatsu
Foil wrote:Snoopy is exactly right.

You know y=x^3 gives you roughly the shape you want in the (-1,1) range, right? Just adjust it a bit to put it exactly where you want it:

y = ((2x-1)^3 + 1) / 2

Easy to verify this hits all the points you want.
Thank you so much, that is exactly what I want! I was just going to go the long method but you saved me :D

Re: What Equation Would Do This?

Posted: Wed Jul 13, 2011 12:52 pm
by Foil
No prob. :)

Re: What Equation Would Do This?

Posted: Thu Jul 14, 2011 8:22 pm
by Burlyman
Oh, I think a logistic function has finite extrema, but that third-order polynomial ranges over all real numbers. It's not easy to tell with that image in your link.