• Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a \$50 Amazon gift card. Click here to get started!

What is this function?

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

7 replies to this topic

#1yahastu  Members   -  Reputation: 152

Like
0Likes
Like

Posted 17 August 2011 - 12:47 PM

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?

#2Brother Bob  Moderators   -  Reputation: 9513

Like
0Likes
Like

Posted 17 August 2011 - 01:07 PM

There are many such functions, such as a quadratic curve f(x)=x2 (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-x2) 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?

#3japro  Members   -  Reputation: 887

Like
0Likes
Like

Posted 17 August 2011 - 01:13 PM

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?

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 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.

#4yahastu  Members   -  Reputation: 152

Like
0Likes
Like

Posted 17 August 2011 - 03:12 PM

There are many such functions, such as a quadratic curve f(x)=x2 (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-x2) 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?

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):

#5Brother Bob  Moderators   -  Reputation: 9513

Like
0Likes
Like

Posted 17 August 2011 - 04:32 PM

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.

#6yahastu  Members   -  Reputation: 152

Like
0Likes
Like

Posted 17 August 2011 - 06:07 PM

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.

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.

#7japro  Members   -  Reputation: 887

Like
0Likes
Like

Posted 18 August 2011 - 02:26 AM

f_k(x) = 0.5*(x^k + 1 - (1-x)^(1/k)) maybe?

#8yahastu  Members   -  Reputation: 152

Like
0Likes
Like

Posted 18 August 2011 - 10:26 AM

f_k(x) = 0.5*(x^k + 1 - (1-x)^(1/k)) maybe?

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!

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS