0

I'm trying to write a function that returns a point on a standard bell curve or Gaussian Distribution.

The function should take a float percent (in the range of zero to one). This is the point on the x-axis for a bell curve and the function would return the corresponding y value (the 'peak' of the bell curve - at 50% - would be a second input value).

I've tried looking into a normal distribution function and sine curves but virtually all the examples I've found involve random number patterns (this function would be entirely deterministic).

The shape of the function would probably be something like this:

function bellCurve(percent, yMaximumValue){
    //do magic

    return newYValue;
}
Mark Taylor
  • 1,128
  • 8
  • 15
  • 1
    Just use the Gaussian function: https://en.wikipedia.org/wiki/Gaussian_function: [like this](https://www.wolframalpha.com/input/?i=e%5E%28-%28x+-+0.5%29%C2%B2+%2F+2*5%C2%B2%29) –  Feb 18 '21 at 23:26
  • I'm not sure what you're doing. Perhaps [this](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/blur()) will help? – StackSlave Feb 18 '21 at 23:29
  • What you want to do is not possible. A percentage does not specify a x value but a x range on the bell curve. This is because all points individually have a 0% chance. I think what you want is [this](https://stackoverflow.com/a/29479418/7448536) – Wendelin Feb 18 '21 at 23:47

0 Answers0