Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

For a project I am working on, I need a formula that can describe a curve between two known endpoints, where the curve will always be upwards sloping and always convex (or flat). There should be many solutions to this but I have not been able to develop any that work.

So in the illustration below, changing the input parameter would change the precise path followed by the function without changing the endpoints, and without violating the conditions that it always be upwards sloping and convex.

Any assistance would be appreciated.

enter image description here

share|improve this question
It appears you want it to sometimes be horizontal at the upper right endpoint, or sometimes vertical at the origin. –  Will Jagy Feb 28 '13 at 2:41
A simplification: find such a family of curves between $(0,0)$ and $(1,1)$, and then translate and scale to the endpoints you actually want. For example, $x^k$ for $k\in(0,1]$, or $1-(1-x)^k$ for $k\in[1,\infty)$. –  Rahul Feb 28 '13 at 2:42

1 Answer 1

Suppose the two end-points are $(x_0, y_0)$ and $(x_1, y_1)$.

Use the function

$$ f(x) = \frac{(x_1-x)^2 y_0 + 2(x_1 - x)(x- x_0)h + (x - x_0)^2 y_1 }{(x_1 - x_0)^2} $$

The $h$ is a free parameter. You can adjust its value between $\tfrac{1}{2}(y_0 + y_1)$ and $y_1$.

If $(x_0, y_0) = (0,0)$ and $(x_1, y_1) = (1,1)$, as in your picture, then this $f$ simplifies greatly. It just becomes

$$ f(x) = (1 - 2h)x^2 + 2hx$$

Again, in this special case, you can adjust $h$ to have any value between 0.5 and 1. When $h=0.5$, you get a straight line. When $h=1$, you get a curve whose tangent is horizontal at the right-hand end.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.