Skip to content

1ort/mandelbrot_cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mandelbrot Fractal Terminal Renderer

This is a simple command-line application that renders the Mandelbrot fractal directly in your terminal. The program allows you to customize various parameters to explore different regions of the fractal and adjust the output size.

Features

  • Customizable Coordinates: Adjust the region of the complex plane to be rendered.
  • Terminal-Friendly Output: The fractal is rendered using ASCII characters, making it easy to view in any terminal.
  • Iterations Control: Set the maximum number of iterations to fine-tune the detail of the fractal.
  • Easy to Use: Simple command-line interface with intuitive options.

Usage

mandelbrot [OPTIONS]

Options

  • --x-min <X_MIN>: Minimal x coordinate (default: -2.5)
  • --x-max <X_MAX>: Maximal x coordinate (default: 1.5)
  • --y-min <Y_MIN>: Minimal y coordinate (default: -1.5)
  • --y-max <Y_MAX>: Maximal y coordinate (default: 1.5)
  • --width <WIDTH>: Image width in characters (default: 100)
  • --height <HEIGHT>: Image height in characters (default: 24)
  • --n-iters <N_ITERS>: Maximum number of iterations for each point (default: 10000)
  • -h, --help: Print help information
  • -V, --version: Print version information

Example

To render the Mandelbrot fractal with a custom region and higher resolution:

mandelbrot --x-min -1.5 --x-max 0.5 --y-min -1.0 --y-max 1.0 --width 150 --height 40 --n-iters 5000
 ............................................................................................••••••••***••••*****••...................................
............................................................................................••••••••••******•••••••••.................................
.........................................................................................••••••••••*+***+*****••••••••................................
....................................................................................••••••***+++***+**+%%%+********•••••..............................
.............................................................................••••••••••••••••**+%%%%%%%%%%%%%+%+***••••••••...........................
.....................................................................•••••••••••••••••••••••***%%%%%%%%%%%%%%%%+*+*•••••••••••••••....................
................................................................•••••••••*•••••••••••••••••*****+%%%%%%%%%%%%%+****••••••••••••••••••••••••*•••.......
...........................................................••••••••****+*****••••***++***+x*++*#+$#x$+x%x+$x%++*+$x*+++****++*••••••••••••***••••.....
........................................................•••••••••••****+%%%%%*+**+x*$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+**+******++*+*******••....
....................................................••••••••••••••••***+%%%%%%+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+*$%%%%%%x+**•••••....
................................................•••••••••••••••*********+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$***•••••••...
................•••••••••••••............•••••••••••••••••••*++++x%x*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%++***•••••••••.
............••••••**••••••••••••••••••••••••••••••••••••••••*****++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#x***••••*•••
...........•••••****••••••••••••••***••••••••••••••••••••**+x+%+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+%%%+****••
..........••••••••••****+*+***********x+******•••••••••••**+*x%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+***••••••
........•••••••••••••***++%%%$*+*%x$%%%%x%+%%*************+x%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+****••••
......••••••••••*********+$%%%%%%%%%%%%%%%%%%%%%%%++******x%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*+*++•••.
••••••**••••••••****+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+**$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*+••••..
•••••••***+*********+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%++••••••..
•*•••******+%%%%%%*+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*+••••••••...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*****••••••••••...
•*•••******+%%%%%%*+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*+••••••••...
•••••••***+*********+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%++••••••..
••••••**••••••••****+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+**$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*+••••..
......••••••••••*********+$%%%%%%%%%%%%%%%%%%%%%%%++******x%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*+*++•••.
........•••••••••••••***++%%%$*+*%x$%%%%x%+%%*************+x%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+****••••
..........••••••••••****+*+***********x+******•••••••••••**+*x%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+***••••••
...........•••••****••••••••••••••***••••••••••••••••••••**+x+%+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+%%%+****••
............••••••**••••••••••••••••••••••••••••••••••••••••*****++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#x***••••*•••
................•••••••••••••............•••••••••••••••••••*++++x%x*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%++***•••••••••.
................................................•••••••••••••••*********+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$***•••••••...
....................................................••••••••••••••••***+%%%%%%+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+*$%%%%%%x+**•••••....
........................................................•••••••••••****+%%%%%*+**+x*$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+**+******++*+*******••....
...........................................................••••••••****+*****••••***++***+x*++*#+$#x$+x%x+$x%++*+$x*+++****++*••••••••••••***••••.....
................................................................•••••••••*•••••••••••••••••*****+%%%%%%%%%%%%%+****••••••••••••••••••••••••*•••.......
.....................................................................•••••••••••••••••••••••***%%%%%%%%%%%%%%%%+*+*•••••••••••••••....................
.............................................................................••••••••••••••••**+%%%%%%%%%%%%%+%+***••••••••...........................
....................................................................................••••••***+++***+**+%%%+********•••••..............................
.........................................................................................••••••••••*+***+*****••••••••................................
............................................................................................••••••••••******•••••••••.................................

Installation

  1. Clone the repository:

    git clone https://github.com/1ort/mandelbrot_cli.git
  2. Navigate to the project directory:

    cd mandelbrot
  3. Build and run the project using Cargo:

    cargo run -- [OPTIONS]

Educational Purpose

This project was created as an exercise from the book "Rust in Action" by Tim McNamara (timClicks). It serves as a practical example of how to implement a simple fractal renderer in Rust.

Note

This README.md was generated by an AI assistant.


Enjoy exploring the Mandelbrot fractal in your terminal! 🌌

About

Simple mandelbrot terminal renderer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages