What Equation Would Do This?

Pyro Pilots Lounge. For all topics *not* covered in other DBB forums.

Moderators: fliptw, roid

Post Reply
User avatar
Dakatsu
DBB Admiral
DBB Admiral
Posts: 1575
Joined: Mon Feb 20, 2006 12:22 am
Location: St. Petersburg, Florida

What Equation Would Do This?

Post 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.
User avatar
Burlyman
DBB Admiral
DBB Admiral
Posts: 1275
Joined: Sun Oct 16, 2005 5:47 pm
Location: right behind you

Re: What Equation Would Do This?

Post by Burlyman »

Oh, that's a logistic function. Try looking up logistic functions and see what you can find out.
--Neo, the fourth greatest pilot in the universe
User avatar
snoopy
DBB Benefactor
DBB Benefactor
Posts: 4435
Joined: Thu Sep 02, 1999 2:01 am

Re: What Equation Would Do This?

Post by snoopy »

You can do it with a third order equation I think.

[ Post made via Android ] Image
Arch Linux x86-64, Openbox
"We'll just set a new course for that empty region over there, near that blackish, holeish thing. " Zapp Brannigan
User avatar
Foil
DBB Material Defender
DBB Material Defender
Posts: 4900
Joined: Tue Nov 23, 2004 3:31 pm
Location: Denver, Colorado, USA
Contact:

Re: What Equation Would Do This?

Post 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.
User avatar
Dakatsu
DBB Admiral
DBB Admiral
Posts: 1575
Joined: Mon Feb 20, 2006 12:22 am
Location: St. Petersburg, Florida

Re: What Equation Would Do This?

Post 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
User avatar
Foil
DBB Material Defender
DBB Material Defender
Posts: 4900
Joined: Tue Nov 23, 2004 3:31 pm
Location: Denver, Colorado, USA
Contact:

Re: What Equation Would Do This?

Post by Foil »

No prob. :)
User avatar
Burlyman
DBB Admiral
DBB Admiral
Posts: 1275
Joined: Sun Oct 16, 2005 5:47 pm
Location: right behind you

Re: What Equation Would Do This?

Post 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.
--Neo, the fourth greatest pilot in the universe
Post Reply