Questions tagged [fractals]

Fractals are interesting mathematical objects with a special behaviour in a complex-plane [Re, Im], depending on their initial position ( location ). Visualised in popular media, typically as shapes with infinite dimensionality that exhibit a sort of self-similarity. Well-known fractal sets include the named Mandelbrot set, Julia sets, and Phoenix sets. Tree-like fractal drawings are also common.

Fractals are shapes that are self-similar.
enter image description here
Their infinite-dimensionality could be best viewed in animated computer simulations.

Fractal sets such as the Mandelbrot set, Julia sets, and Phoenix sets are commonly used for a fast, approximate ( iterative ) method of how to determine a point's membership in such a set in a complex-plane [Re, Im]. For example, if the absolute value of an iterative complex function ( defining the Mandelbrot, or another set ), the module, never grows beyond a given treshold, then the original point in complex-plane [Re, Im], the argument of the complex-function, is considered a member of the set.

Image presented by **flashliquid** Fractal trees - drawings that resemble trees in nature can be drawn in high detail with recursive algorithms.

544 questions
81
votes
12 answers

How to program a fractal?

I do not have any experience with programming fractals. Of course I've seen the famous Mandelbrot images and such. Can you provide me with simple algorithms for fractals. Programming language doesn't matter really, but I'm most familiar with…
Sander Versluys
  • 72,737
  • 23
  • 84
  • 91
49
votes
8 answers

Function with varying number of For Loops (python)

My problem is difficult to explain. I want to create a function that contains nested for loops, the amount of which is proportional to an argument passed to the function. Here's a hypothetical example: Function(2) ...would involve... for x in range…
Anti Earth
  • 4,671
  • 13
  • 52
  • 83
40
votes
15 answers

Code golf: the Mandelbrot set

Usual rules for the code golf. Here is an implementation in python as an example from PIL import Image im = Image.new("RGB", (300,300)) for i in xrange(300): print "i = ",i for j in xrange(300): x0 = float( 4.0*float(i-150)/300.0…
Stefano Borini
  • 138,652
  • 96
  • 297
  • 431
37
votes
7 answers

Smooth spectrum for Mandelbrot Set rendering

I'm currently writing a program to generate really enormous (65536x65536 pixels and above) Mandelbrot images, and I'd like to devise a spectrum and coloring scheme that does them justice. The wikipedia featured mandelbrot image seems like an…
Nick Johnson
  • 100,655
  • 16
  • 128
  • 198
36
votes
8 answers

Practical Uses of Fractals in Programming

Fractals have always been a bit of a mystery for me. What practical uses (beyond rendering to beautiful images) are there for fractals in the various programming problem domains? And please, don't just list areas that use them. I'm interested in…
Sami
  • 3,263
  • 3
  • 29
  • 37
21
votes
8 answers

Calculate the Hilbert value of a point for use in a Hilbert R-Tree?

I have an application where a Hilbert R-Tree (wikipedia) (citeseer) would seem to be an appropriate data structure. Specifically, it requires reasonably fast spatial queries over a data set that will experience a lot of updates. However, as far as…
user89335
20
votes
7 answers

Fractal Encryption

I've heard that one can encrypt data using drawings of the Mandlebrot set, and that this encryption algorithm is quantum-safe (can't be broken with a quantum computer, unlike many commonly-used algorithms). I looked around on Google for more…
Imagist
  • 18,086
  • 12
  • 58
  • 77
16
votes
2 answers

What does "for x in y or z:" do in Python?

I'm trying to take apart and de-obfuscate this mandlebrot-generating python code: _ = ( 255, lambda V…
Nick Sweeting
  • 5,364
  • 5
  • 27
  • 37
15
votes
6 answers

Buddhabrot Fractal

I am trying to implement buddhabrot fractal. I can't understand one thing: all implementations I inspected pick random points on the image to calculate the path of the particle escaping. Why do they do this? Why not go over all pixels? What purpose…
Hamza Yerlikaya
  • 49,047
  • 44
  • 147
  • 241
14
votes
2 answers

In need of Fractional Brownian Noise (FBM) vs Perlin Noise clarification

I'm researching the various types of noise for terrain generation and I'm a little confused regarding when noise becomes perlin noise and when perlin noise becomes fbm. I'm hoping somebody could clarify anywhere that I'm going wrong. I currently…
user2211776
  • 239
  • 1
  • 2
  • 11
12
votes
1 answer

Python fractal box count - fractal dimension

I have some images for which I want to calculate the Minkowski/box count dimension to determine the fractal characteristics in the image. Here are 2 example images: 10.jpg: 24.jpg: I'm using the following code to calculate the fractal…
Simon
  • 9,762
  • 15
  • 62
  • 119
12
votes
1 answer

Looping through a formula that describes a spiral to generate XY coordinates

I'm trying to generate a spiral galaxy in the form of xy (2D) coordinates -- but math is not my strong suit. I've gleaned the following from an excellent source on spirals: The radius r(t) and the angle t are proportional for the simpliest…
Nick
  • 2,872
  • 3
  • 34
  • 43
11
votes
5 answers

Drawing Flame Fractals

I am looking for information on how to draw flame fractals from googling around I could not find much, either pages explain how to use third party tools or way too complicated for me to grasp. Anyone know how/why they work? or point me in the…
Hamza Yerlikaya
  • 49,047
  • 44
  • 147
  • 241
10
votes
5 answers

Generating the Sierpinski triangle iteratively in Mathematica?

I have written code which draws the Sierpinski fractal. It is really slow since it uses recursion. Do any of you know how I could write the same code without recursion in order for it to be quicker? Here is my code: midpoint[p1_, p2_] := Mean[{p1,…
John
  • 277
  • 3
  • 13
10
votes
4 answers
1
2 3
36 37