Barnsley fern is a fractal shape created by mathematician Michael Barnsley. The geometric features of this fractal resemble a natural fern and hence it gets its name. Barnsley fern is created by iterating over a large number of times on four mathematical equations, introduced by Barnsley, known as Iterated Function System (IFS).
The transformation Barnsley used had the formula :
where, the letters had following value :
and “p” is the probability.
Thus the four equations are:
With the help of above equations, the fern is created. Now lets see the Python3 implementation for the same.
Note: The whole output depends upon the coefficients of the equations. One experiment might be to change the coefficients and get a new pattern every time.
- Python - Read blob object in python using wand library
- Python | Convert list to Python array
- MySQL-Connector-Python module in Python
- Python | PRAW - Python Reddit API Wrapper
- Python | Index of Non-Zero elements in Python list
- twitter-text-python (ttp) module - Python
- Python | Merge Python key values to list
- Important differences between Python 2.x and Python 3.x with examples
- Reading Python File-Like Objects from C | Python
- Python | Sort Python Dictionaries by Key or Value
- Python | Add Logging to Python Libraries
- Python | Add Logging to a Python Script
- Python | Set 4 (Dictionary, Keywords in Python)
- Python | Visualizing O(n) using Python
- Python | a += b is not always a = a + b
- pow() in Python
- gcd() in Python
- Use of min() and max() in Python
- Python Try Except
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.