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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a particular curve algorithm that is similar to to a bell curve/distribution, but instead of approaching zero at its ends, it stops at its length/limit. You specify the length of the curve of the curve and its maximum peak, and the plot will approach its peak at the midpoint of length(the middle) and then it curves downward to its end. As a math noob, I may not be making any sense. Here's an image of the curve I'm looking for:

my curve

share|cite|improve this question
Can you describe what the intended application is? – Qiaochu Yuan May 16 '11 at 19:28
Sure, I'm interested in creating a curved duty cycle signal for some software that will send a signal to various electronics. Normally duty cycles use a square wave for HI/LO state over a period of time. Instead, I'd like the approach to the peak value to be curved/interpolated instead of an immediate jump(as performed in a square wave). I can make a graphic of the intended curve/signal if this explanation isn't clear. – dhulihan May 16 '11 at 21:30
Wouldn't the crest of a sinusoid be appropriate? – J. M. May 16 '11 at 23:35
@J.M. - As in a Crest Factor? – dhulihan May 17 '11 at 1:54
If you plot $\sin x$, the part in the interval $[0,\pi]$ is a "crest". – J. M. May 17 '11 at 2:36

Thanks to J.M.'s help, I was able to create the appropriate curve using sine wave and length of $\pi$(since $\pi$ is the point at which the curve approaches zero in a positive phase). I graphed this example using javascript and flot:

var d1 = [];
for (var x = 0; x < Math.PI; x += 0.1)
    d1.push([x, Math.sin(x)]);  

This means you can also adjust the length of the wave/curve by adding a multiplier to x:

var d2 = [];
var wavelength = 2
for (var x = 0; x < Math.PI; x += 0.1){
    var y =  Math.sin(x * wavelength)
        d2.push([x, y]);  

Here's an image of the result:

share|cite|improve this answer

The curve which you are looking for is a parabola. When I plugged in the equation $$f(x) = -(x-3.9)^{2} + 4$$ I got this figure, which some what resembles what you are looking for.

enter image description here

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