fractals

why mandelbrot's boundary is 2? [closed]

被刻印的时光 ゝ 提交于 2019-12-11 19:52:38
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I'm trying to understand why we're iterating through Mandelbrot points until |z| < 4. why 4? is there somekind of a law? or is it based on statistical measurements? thanks, igal 回答1: Consider the Mandelbrot set with along y=0, which would would be z(i) = z(i-1)^2 + c . Consider when c = (x=-2, y=0) z(0) = 0 z(1)

Need help in printing fractal tree

家住魔仙堡 提交于 2019-12-11 16:59:19
问题 I need some help in printing fractal tree using JavaScript. I have written code which prints tree sequence according to the rules defined for the tree, but having some trouble to print the tree. Thanks for all the help. Here is the code: var sentence = "F"; var rules = []; rules[0] = { a: "F", b: "F[+F]F[-F]F" } setup(); function setup() { turtle(); for (i = 0; i < 2; i++){ generate(); } } function turtle(){ var canvas = document.getElementById("myCanvas"); var context = canvas.getContext('2d

Need help making a Hilbert Curve using numbers in Python

こ雲淡風輕ζ 提交于 2019-12-11 14:46:20
问题 I want to make a function that will create a Hilbert Curve in python using numbers. The parameters for the function would be a number and that will tell the function how many times it should repeat. To make a Hilbert Curve you start with 'L', then that turns into '+RF-LFL-FR+', and then 'R' turns into '-LF+RFR+FL-' How should I do this? #Here is what I've made so far def hilbert(num): s = 'L' for i in range(num-1): s = s.replace('L','+RF-LFL-FR+') b = 'R' for i in range(num-1): b = b.replace(

Fractal image scaling with Python

微笑、不失礼 提交于 2019-12-07 08:55:12
问题 I am in a position where relatively low resolution images are provided (via an API, higher resolution images are not available) and high resolution images need to be generated. I've taken a look at PIL and it's just great for about everything... Except scaling up images. It has the common resizing algorithms: Nearest Neighbor Bilinear Bicubic Anti-aliased I would like to use Fractal Resizing (as per jeff's post on coding horror), but alas, PIL has no support for this kind of resizing. Further

Dimensions of fractals: boxing count, hausdorff, packing in R^n space

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 11:52:24
问题 I would like to calculate dimensions of fractal written as a n-dimensional array of 0s and 1s. It includes boxing count, hausdorff and packing dimension. I have only idea how to code boxing count dimensions (just counting 1's in n-dimensional matrix and then use this formula: boxing_count=-log(v)/log(n); where n-number of 1's and n-space dimension (R^n) This approach simulate counting minimal resolution boxes 1 x 1 x ... x 1 so numerical it is like limit eps->0 . What do you think about this

Unit testing algorithms that involve random numbers

拈花ヽ惹草 提交于 2019-12-05 11:56:14
I'm writting some code about fractals and random terrain generation. Specifically, I'm using the Diamond-Square algorithm as of now. For those of you who don't know, it basically obtains the average of four values, and adds a random number, every step. How wouldI go about testing the result? Should I use a known seed and calculate by hand the average plus the random value, or what? Should I, instead, calculate the result in the code, using the random numbers? Or is there another way? Also, some thought on the reverse process (a.k.a. TDD, writting tests before code) would be much appreciated).

Max resolution of .bmp file format

邮差的信 提交于 2019-12-05 06:10:11
问题 I have made a Mandelbrot fractal generator (who hasn't, I know) which can render directly to disk to generate huge fractals. My first test was a UHD 4k resolution which turned out great (8-bit colour for all of these examples). So I decided to go a little crazy and went 10x bigger in both dimensions, i.e. 38400 x 21600. The resulting file doesn't appear valid in that Photoshop can't open it but even looking at the file properties in Windows Explorer shows that the dimensions/etc are missing.

Implementing the Koch Curve?

混江龙づ霸主 提交于 2019-12-05 02:12:53
问题 I was looking at the wikipedia page for the Koch Snowflake (here) and was bothered by the all the examples all being in the logo/turtle style. So i set out to make my own that returned a list or coordinates. My implementation is in python and i basically ripped off the python turtle implementation but replaced the turtle specific stuff with basic trig. It resulted in some ugly code. My challenge for you is to either improve my code or come up with a more elligant solution of your own. It can

Dimensions of fractals: boxing count, hausdorff, packing in R^n space

北战南征 提交于 2019-12-04 16:41:35
I would like to calculate dimensions of fractal written as a n-dimensional array of 0s and 1s. It includes boxing count, hausdorff and packing dimension. I have only idea how to code boxing count dimensions (just counting 1's in n-dimensional matrix and then use this formula: boxing_count=-log(v)/log(n); where n-number of 1's and n-space dimension (R^n) This approach simulate counting minimal resolution boxes 1 x 1 x ... x 1 so numerical it is like limit eps->0 . What do you think about this solution? Do you have any idea (or maybe code) for calculating hausdorff or packing dimension? The

Mandelbrot Set Fractal Code

眉间皱痕 提交于 2019-12-04 15:55:13
I use the following Complex class file for Complex variables. The java code below is an example of iterations calculator for Mandelbrot Set. public int iterations(Complex no) { Complex z = no; int iterations = 0; while (z.modulusSquared() < 4 && iter <= MAX_ITERATIONS) { z = z.square(); z = z.add(y); iter++; } return iter; } Thanks in advance! I think in the function squared you need to use the absolute value: public Complex square() { double newreal; double newimaginary; newreal = ((real * real) - (imaginary * imaginary)); newimaginary = 2 * abs(imaginary * real); return new Complex(newreal,