I am a computer programmer working on a project that requires me to transform an image into the approximate shape of a bell curve (normal distribution curve). What I need is a math formula for a simple bell curve that I can pass in the X coordinate and have the Y coordinate be returned. I have looked around the internet for answers, but the formulas I have found have characters that are unknown to me, a non-mathematician. If you can help, I would appreciate it!

  • $\begingroup$ Functions of the form $y\left(x\right)=\exp\left(-\frac{\left(x-a\right)^2}{b}\right)$ give you Gaussians centred at $x=a$ with 'flatness' given by the $b$ parameter. $\endgroup$ – WJG Mar 5 '17 at 0:17
  • $\begingroup$ wolframalpha.com/input/?i=y%3Dexp(-(x-1)%5E2%2F2), for example ($a=1$, $b=2$). :) $\endgroup$ – WJG Mar 5 '17 at 0:19
  • $\begingroup$ @WJG - Ok, can you help me further...what do I plugin for the "a" parameter? And what does "exp" mean? Sorry, I have forgotten a lot since math class back in 1984! $\endgroup$ – Joe Gayetty Mar 5 '17 at 0:23
  • $\begingroup$ @WJG - Sorry my last comment got passed by your second one...that second one looks like something I can understand! Thanks. I will give it a closer look. $\endgroup$ – Joe Gayetty Mar 5 '17 at 0:25
  • $\begingroup$ Sorry...I am still stumped at "exp" and/or "e" means. $\endgroup$ – Joe Gayetty Mar 5 '17 at 0:26

A normal distribution curve depends on two parameters: the mean (written $\mu$) and the variance (written $\sigma^2$). Wikipedia's page on normal distribution gives you the general formula where you can adapt these parameters. The first parameter $\mu$, the mean, indicates the center of symmetry of the curve. Whereas $\sigma^2$, the variance, describes how flat or spread the curve is. If you want to ignore as many parameters as possible, I suggest you use the following.

Given a number $x$, the returned $y$ is: \begin{equation} y=f(x)=e^{-x^2} \end{equation} In other words, given $x$, take its square $x^2$, then take the exponential of $-x^2$.

If you want more flexibility in your curve, use the general formula of Wikipedia's page where you replace $\mu$ and $\sigma^2$ by whatever parameters you like.

| cite | improve this answer | |
  • 1
    $\begingroup$ Thank you for the assistance in plain language. You should be a math teacher! I will certainly play around with the formula you provided...thanks again! $\endgroup$ – Joe Gayetty Mar 5 '17 at 0:44
  • $\begingroup$ Thank you for your kind comment. $\endgroup$ – Thibaut Dumont Mar 7 '17 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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