Skip to main content

A playground for experimenting and getting mesmerized by the wonderful world of brots!

Project description

License: MIT made-with-python Binder

logo

Brotground

This python package is for people who want to learn and explore the wonderful world of brots. Provides an api that allows rapid experimenting and visualization.

pip install brotground

Features

  1. Light weight, well documented, easy to understand code base
  2. Extremely modular, Replace any module with your own definition
  3. Flexible, Comes with good defaults but can be overridden
  4. Zero Effort Setup, Includes google colab notebooks to start experimenting without any setup
  5. Minimal Dependency, Numba for iteration and Matplotlib for rendering

Overview

Brots are generalization of Mandelbrot that takes a generic Mandelbrot equation. This library makes every part of the Mandelbrot equation as a parameter offering extreme flexibility to override or use the default implementation.

An equation means nothing to me unless it expresses a thought of God. — Srinivasa Ramanujan

A Standard Mandelbrot equation,

when implemented and rendered will look like this,
mandel = MandelBrot() # Initialize Mandelbrot
matplot_renderer = MatplotJupyterRenderer() # Initialize the renderer

mandel.iterate_diverge(max_iterations=25) # Run the iterate diverge loop
matplot_renderer.plot(mandel, cmap="RdGy") # Plot the results

mandelbrot-simple

We can further zoom in on the coordinates and iterate-diverge on those coordinates,

mandel.set_boundaries((-0.02, 0.02), (0.780, 0.820)) # Zoom in on the coordinates
mandel.iterate_diverge(max_iterations=100)
matplot_renderer.plot(mandel, cmap="plasma")

will render like below,

mandelbrot-zoomed

By changing each part of the equation you can get a range of generation. Generalizing the above Mandelbrot equation to k, we get Multibrot where,

For a K value of 3 we get a Multibrot rendered like this,

multi = MultiBrot()

multi.iterate_diverge(max_iterations=15)
matplot_renderer.plot(multi, cmap="binary")

multibrot

A Tricorn brot is expressed as,

tricorn = UserBrot(brot_equation=tricorn_brot_equation)

tricorn.iterate_diverge(max_iterations=15)
matplot_renderer.plot(tricorn, cmap="RdYlBu")

tricorn

A Burning ship brot is expressed as,

burning_ship = UserBrot(brot_equation=burning_ship_brot_equation)

burning_ship.iterate_diverge(max_iterations=15)
matplot_renderer.plot(burning_ship, cmap="copper")

burning-ship

JuliaBrot is an extension to Mandelbrot, in which instead of initializing Z and C as 0 and complex(i, j) respectively we initialize Z as complex(i, j) and C as a function f(i, j) based on the julia set that we want to generate.

For example, to generate a `` julia set we initialize C as complex(-0.7, 0.35) and this generates the following,

julia = JuliaBrot(julia_name="frost_fractal")
julia.iterate_diverge(max_iterations=100)

matplot_renderer.plot(julia, cmap="inferno")

frost-fractal

julia = JuliaBrot(julia_name="galaxiex_fractal")
julia.iterate_diverge(max_iterations=100)

matplot_renderer.plot(julia, cmap="inferno")

galaxiex-fractal

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brotground-0.1.3.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brotground-0.1.3-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file brotground-0.1.3.tar.gz.

File metadata

  • Download URL: brotground-0.1.3.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.8.2 Windows/10

File hashes

Hashes for brotground-0.1.3.tar.gz
Algorithm Hash digest
SHA256 aa5a8dd2912e83df4b17f7bf36f3061bb2df3a0055b8ba1fc71babb98ac764fd
MD5 75150113444fd676c037fa57ed77f97e
BLAKE2b-256 e10d4b2a5aeea579bed4f9df0c0d9ef29008034e6e10f4d00ddb65f02b5865b8

See more details on using hashes here.

File details

Details for the file brotground-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: brotground-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.8.2 Windows/10

File hashes

Hashes for brotground-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2c8e659a2d318a7b024292c5d4dfad4ae3ccb0c8db2c5b6838d589e553bcff1d
MD5 dbcb007622a60660ac8b69d7fadb9f0c
BLAKE2b-256 d6bf40a0bd8f3586d98c4c7d68b55c84a7a8cd9c78fa78420951ca8fe1dd00d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page