Skip to content

Latest commit

 

History

History
256 lines (176 loc) · 13.4 KB

README.md

File metadata and controls

256 lines (176 loc) · 13.4 KB

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Fractal Lab

Welcome to the Fractal Lab, a Python platform for exploring and generating mesmerizing fractal patterns. This repository provides a collection of fractal algorithms and interactive tools to help you dive into the fascinating world of fractals.
Explore the docs »

Report Bug · Request Feature

Table of Contents

  1. What are Fractals
  2. How Fractal Algorithms Work
  3. Getting Started
  4. Usage
  5. Roadmap
  6. Contributing
  7. License
  8. Contact
  9. Acknowledgements

What are Fractals

Fractals are complex and intricate geometric patterns that exhibit self-similarity at different scales. They are created through the repetition of a simple mathematical process or algorithm. Fractals are characterized by their intricate detail and infinite complexity, even though they are created from simple rules.

Fractals can be generated using iterative processes, where a basic shape or pattern is repeatedly transformed or replicated according to specific rules. The iteration continues indefinitely or until a certain condition is met. As the process repeats, the pattern evolves and becomes increasingly complex, often exhibiting self-similarity, meaning that smaller portions of the fractal resemble the larger whole.

Fractals are closely related to mathematical concepts such as recursion, infinite sequences, and chaotic systems. They are widely used in various fields, including mathematics, computer graphics, physics, biology, and art.

Fractal geometry has many interesting properties, such as infinite detail, non-integer dimensionality, and the ability to create intricate and fascinating patterns. Fractals can be found in nature, including in coastlines, clouds, mountains, trees, and even in the structure of our lungs and blood vessels.

Exploring and studying fractals can provide insights into the underlying structures and processes that govern complex systems in nature and mathematics. They also offer a creative and visually appealing way to explore mathematical concepts and generate aesthetically pleasing patterns and images.

Note: (written by ChatGPT)

How Fractal Algorithms Work

Fractal algorithms work by iteratively applying a set of mathematical rules or transformations to generate complex and self-repeating patterns. These algorithms typically operate on a discrete grid or set of points and use recursion or iteration to create intricate fractal structures.

Here is a general overview of how fractal algorithms work:

  • Initialization: Fractal algorithms begin with an initial shape or set of points. This could be a simple geometric shape like a line segment, triangle, or square, or it could be a set of randomly distributed points.
  • Iteration: The algorithm then applies a series of transformations or calculations to each point or element in the set. These transformations define how the points will be modified or how new points will be generated.
  • Recursion: In many fractal algorithms, recursion is used to repeatedly apply the transformations to subsets or subregions of the initial set of points. This recursive process is often responsible for creating self-similarity within the fractal structure.
  • Convergence or Termination: The iteration process continues until a certain condition is met, such as reaching a maximum number of iterations or when the points converge to a stable pattern. Alternatively, the algorithm can be stopped at any desired iteration to control the level of detail or complexity in the resulting fractal.
  • Visualization: Once the fractal algorithm has completed, the resulting set of points or grid can be visualized. Various techniques can be used to render the fractal, such as plotting the points on a grid, connecting them with lines or curves, or assigning colors based on specific properties or calculations.

Different types of fractals, such as the Mandelbrot set, Julia sets, Sierpinski triangle, and Koch snowflake, have their own specific algorithms and rules for generating their unique structures. However, the general principles of iteration, recursion, and transformation are common to many fractal algorithms.

Fractal algorithms provide a way to generate complex and visually appealing patterns, explore self-similarity, and discover the intricate nature of mathematical and natural phenomena. They have applications in various fields, including mathematics, computer graphics, art, and science.

Note: (written by ChatGPT)

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

Installation

  1. Clone the repo
git clone https://github.com/jtcass01/FractalLab.git

Usage Examples

Julia set

from FractalLab import Julia

# Set the desired parameters
width, height = 1000, 1000
xmin, xmax = -2, 2
ymin, ymax = -2, 2
max_iter = 100
cmap = 'gist_stern'

julia_set: Julia = Julia(width=width, height=height, xmin=xmin, xmax=xmax,
                         ymin=ymin, ymax=ymax, constant=Julia.KNOWN_CONSTANTS[-1])
julia_set.animate(iterations=100, cmap=cmap, xmin=xmin, xmax=xmax,
                  ymin=ymin, ymax=ymax)

julia_fractal_animation

Iteration 1

julia_fractal_1

Iteration 500

julia_fractal_500

Mandelbrot set

from FractalLab import Mandelbrot

# Set the desired parameters
width, height = 2000, 2000
xmin, xmax = -2.5, 1.5
ymin, ymax = -2, 2
max_iter = 200
cmap = 'gist_stern'

mandelbrot_test: Mandelbrot = \
    Mandelbrot(width=width, height=height, xmin=xmin,
                xmax=xmax, ymin=ymin, ymax=ymax)
mandelbrot_test.animate(iterations=100, cmap=cmap, xmin=xmin,
                        xmax=xmax, ymin=ymin, ymax=ymax)

mandelbrot_fractal_animation

Iteration 1

mandelbrot_fractal_1

Iteration 200

mandelbrot_fractal_200

Burning Ship set

from FractalLab import BurningShip

# Set the desired parameters
width, height = 2000, 2000
xmin, xmax = -2, 2
ymin, ymax = -2, 2
max_iter = 100
cmap = 'inferno'

burning_ship_test: BurningShip = BurningShip(width=width, height=height,
                                              xmin=xmin, xmax=xmax,
                                              ymin=ymin, ymax=ymax)
burning_ship_test.animate(iterations=100, cmap=cmap,
                          xmin=xmin, xmax=xmax,
                          ymin=ymin, ymax=ymax)

Roadmap

The Fractal Lab is an evolving project, and there are exciting plans for its future development. Here's a roadmap that outlines the upcoming features and improvements:

  • Interactive GUI: Create an intuitive and user-friendly Graphical User Interface (GUI) that allows users to modify fractal parameters in real-time. The GUI should provide sliders, input fields, and interactive controls to adjust variables such as zoom level, iteration count, color schemes, and other relevant parameters. This will provide a seamless and engaging experience for users to interact with and explore fractal patterns.

  • Dynamic Visualization: Enhance the visualization capabilities of the playground to support dynamic and real-time rendering of fractal patterns as parameter values are modified. Implement live updates of the fractal visualizations to reflect the changes made by users, allowing them to observe the immediate impact on the generated patterns.

  • Additional Fractal Algorithms: Expand the collection of fractal algorithms in the playground. Introduce new algorithms such as the Burning Ship fractal, Newton fractal, Dragon Curve, Barnsley fern, and others. Provide implementation examples and interactive tools for each algorithm, enabling users to explore a wide range of captivating fractal structures.

  • Fractal Exploration Tools: Introduce tools and features that aid in the exploration and navigation of fractal spaces. Implement pan and zoom functionalities to allow users to navigate within the fractal patterns effortlessly. Add the ability to bookmark or save favorite views and zoom levels for future reference.

  • Educational Resources Expansion: Expand the educational resources section to include tutorials, articles, and interactive lessons that delve deeper into the mathematics and concepts behind fractals. Provide step-by-step guides on implementing and understanding fractal algorithms, along with examples of real-world applications and artistic interpretations.

  • Performance Optimization: Continuously optimize the algorithms and visualization techniques to improve performance and allow for the generation of larger and more intricate fractal patterns. Utilize parallel processing, caching techniques, and algorithmic optimizations to enhance the speed and efficiency of the fractal generation process.

The roadmap outlines the future development plans for the Fractal Lab, aiming to provide a comprehensive and interactive environment for exploring, creating, and sharing captivating fractal patterns. Stay tuned for updates and new releases as we continue to expand the possibilities of fractal exploration in Python.

See the open issues for a list of proposed features (and known issues).

Note: (written by ChatGPT)

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Your Name - @Jacob_Cassady - [email protected]

Project Link: https://github.com/jtcass01/FractalLab

Acknowledgements

  • OpenAI's ChatGPT: For providing insightful and prompt responses to questions and problems encountered during the development of this project. The AI also greatly assisted in generating comments and documentation, making the code more readable and maintainable. Please note, this acknowledgement was also drafted with assistance from ChatGPT. OpenAI