Sign in to follow this  
yahastu

What is this function?

Recommended Posts

yahastu    154
I'm trying to find a continuous 1-parameter function that transitions smoothly between f(x)=x on one extreme, and at the other extreme, f(0)=0 and f(1)=1...
Picture tying a string between (0,0) and (1,1) and then pulling the string from the midpoint towards the corner (0,1). Can anyone think of such a function?

Share this post


Link to post
Share on other sites
Brother Bob    10344
There are many such functions, such as a quadratic curve f(x)=x[sup]2[/sup] (or any power larger than 1) , a cosine shape f(x)=1-cos(x*pi/2), or a circular shape f(x)=1-sqrt(1-x[sup]2[/sup]) for example. Do you have any additional constraint on the shape of the curve to narrow down the options if these ones are not what you're looking for?

Share this post


Link to post
Share on other sites
japro    887
[quote name='yahastu' timestamp='1313606832' post='4850430']
I'm trying to find a continuous 1-parameter function that transitions smoothly between f(x)=x on one extreme, and at the other extreme, f(0)=0 and f(1)=1...
Picture tying a string between (0,0) and (1,1) and then pulling the string from the midpoint towards the corner (0,1). Can anyone think of such a function?
[/quote]

[url="http://www.codecogs.com/eq.latex?%20f_k%28x%29%20=%20x%5Ek"]f_k(x) = x^k[/url]

has f_k(0) = 0 and f_k(1) = 1 for all k and f_1(x) = x and pointwise converges to the other function you describe for k->infinity.

edit: how do I make this latex stuff work? If I use the image tag is says I'm not allowed to use that image extension.

Share this post


Link to post
Share on other sites
japro    887
Hidden
[quote name='yahastu' timestamp='1313606832' post='4850430']
I'm trying to find a continuous 1-parameter function that transitions smoothly between f(x)=x on one extreme, and at the other extreme, f(0)=0 and f(1)=1...
Picture tying a string between (0,0) and (1,1) and then pulling the string from the midpoint towards the corner (0,1). Can anyone think of such a function?
[/quote]


<img src="http://www.codecogs.com/eq.latex? f_k(x) = x^k" />has f_k(0) = 0 and f_k(1) = 1 for all k and f_1(x) = x and pointwise converges to the other function you describe.

Share this post


Link to post
yahastu    154
[quote name='Brother Bob' timestamp='1313608072' post='4850443']
There are many such functions, such as a quadratic curve f(x)=x[sup]2[/sup] (or any power larger than 1) , a cosine shape f(x)=1-cos(x*pi/2), or a circular shape f(x)=1-sqrt(1-x[sup]2[/sup]) for example. Do you have any additional constraint on the shape of the curve to narrow down the options if these ones are not what you're looking for?
[/quote]

The key criterion that I have not found any function to satisfy yet is:

"Picture tying a string between (0,0) and (1,1) and then pulling the string from the midpoint towards the corner (0,1)"

In other words, the functions should look like the attached picture (poor drawing but you should get the idea):

Share this post


Link to post
Share on other sites
Brother Bob    10344
So my functions bent the curve to the wrong corner according to your picture, but that's just a matter of inverting them. Looks like you want the power function japro and I suggested, and you adjust k depending on how much you want the function to approach the corners. If k approaches 0, it is bent towars the upper left corner in your graph, and if it approaches infinity it is bent towards the lower right corner.

Share this post


Link to post
Share on other sites
yahastu    154
[quote name='Brother Bob' timestamp='1313620353' post='4850508']
So my functions bent the curve to the wrong corner according to your picture, but that's just a matter of inverting them. Looks like you want the power function japro and I suggested, and you adjust k depending on how much you want the function to approach the corners. If k approaches 0, it is bent towars the upper left corner in your graph, and if it approaches infinity it is bent towards the lower right corner.
[/quote]

Sorry, I guess I'm not explaining myself clearly enough. When I said "pulled from the midpoint towards (0,1)" I meant that the curves should be symmetric about the line X-1 for all parametric values.
The circle equation you gave is just a single function, it does not describe a parametric family of curves that includes the line f(x)=x.

I can think of a way to do this but it uses a Bezier spline segment, with vertices at (0,0) and (0,1), and then define a parametric path for the control points. ie, the parametric value could slide a reference point along the line X-1, and then the control points could be defined by the vector from this reference point to the starting vertex, with the length of this vector being a hard-coded value. I just feel like there has to be a simpler way to define this family of curves.[attachment=4967:funcs2.jpg]

Share this post


Link to post
Share on other sites
yahastu    154
[quote name='japro' timestamp='1313656012' post='4850652']
f_k(x) = 0.5*(x^k + 1 - (1-x)^(1/k)) maybe?
[/quote]

Nice! Modified to fit the coordinate system I described,
f_k(x) = 1 - 0.5*((1-x)^k + 1 - x^(1/k))

It's not perfectly symmetric, but close enough for me!

Share this post


Link to post
Share on other sites
Hidden
you could use:

f_k(x) = (1-abs(x-1)^k)^(1/k)

for k = 1 -> infinity

These 'are' perfectly symmetrical: [url="http://www.mathsisfun.com/graph/function-grapher.php?func1=(1-abs(x-1)^2.75)^(1/2.75)&func2=(1-abs(x-1)^1.25)^(1/1.25)&xmin=-0.4394625&xmax=1.4125625&ymin=-0.129233333333333&ymax=1.10545"]Examples[/url]

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this