ERF!

This is going to be a complicated post, that probably will make no sense to anyone. Mathematicians might have a better chance, but I don’t exactly know the terms they use so I may be making up my own inadvertently. I’ll probably find this all confusing if I look back at it in a month. For a better use of the word “erf”, may I suggest Erfworld, an amusing webcomic.
So, for the generation of fractal landscape, I should be using the gaussian function. With a random number generator, this creates a better distribution for making landscape. But, I’ve been using a straight linear random number generator. So instead of a bell curve of probability, I have a straight line probability.
In other words, my random number generator is just as likely to make an extremely high positive or negative number, as any other number. I should have been using a random number generator that is more likely to generate a zero than an extreme value. This would cause the land generated to be more even and less… spiky?
Anyway, I’ve been researching the gaussian function. Wikipedia is generally confusing, but it does give me the formula for the distribution. That doesn’t really help me though, I need to make numbers into that distribution, not see the end result of the probabilities. The best way to do that is to take the integration of that. Unfortunately mathematicians assure me that it is very difficult to do that. So I’ve been thinking of using a simple upside-down parabola as my distribution and integrating that.
Fortunately I’ve been having difficulty remembering how to do the integration of said parabola, and then what to do once I’ve got it. I say fortunately, because I realized this evening that I can’t be the only person to have this issue. I quick search under “generate gauss function” and I find that in Matlab (whatever that is) there is a function called “erf” that does exactly what I want. And even better, I’ve found that it is part of the standard math library that is on my Mac.
Happy day. I get to ignore higher order math problems and get straight to programming. This change will require tweaking of other parts to get the distribution proper, but it looks very promising.