# Non-mathematician needs a basic bell curve formula taking X and returning Y.

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!

• 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. – WJG Mar 5 '17 at 0:17
• wolframalpha.com/input/?i=y%3Dexp(-(x-1)%5E2%2F2), for example ($a=1$, $b=2$). :) – WJG Mar 5 '17 at 0:19
• @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! – Joe Gayetty Mar 5 '17 at 0:23
• @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. – Joe Gayetty Mar 5 '17 at 0:25
• Sorry...I am still stumped at "exp" and/or "e" means. – Joe Gayetty Mar 5 '17 at 0:26

## 1 Answer

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: $$y=f(x)=e^{-x^2}$$ 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.

• 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! – Joe Gayetty Mar 5 '17 at 0:44
• Thank you for your kind comment. – Thibaut Dumont Mar 7 '17 at 22:30