This code was created by the great Mathematician Michael Barnsley. It is fractal in shape, and the geometric features resemble that of a natural fern, and so it gets its name from this. It is there by iteration over a large number of times on four mathematical equations. So, it was introduced by Barnsley and is known as the iterated function system(IFS). Now, we will create one such code in python for data science.
Barnsley uses the following formula for transformation.
The letters have the following values:
p is the probability.
The four equations are as follows:
We will create the fern using the above equations. Now we will see the same in Python 3.
OUTPUT:
Note: The output will depend on the coefficients of the equation.
So, to learn more about it in python for data science, you can check this and this as well.