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

191 Views Asked by At

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!

1

There are 1 best solutions below

2
On BEST 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: \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.