finnatsea / fractal

A simple mandelbrot fractal generator in rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mandelbrot Fractal Generator

A simple Rust program that generates a Mandelbrot fractal image and saves it as a grayscale PNG file.

Dependencies

  • image (version 0.24.5) for image manipulation and saving.
  • num-complex (version 0.4) for complex number calculations.

Usage

  1. Install Rust and Cargo, if you haven't already, by following the instructions on the official website.
  2. Clone this repository:
git clone https://github.com/finnatsea/mandelbrot-fractal-generator.git
cd mandelbrot-fractal-generator
  1. Run the program:
cargo run

The program will generate a grayscale Mandelbrot fractal image with dimensions 800x800 pixels and save it as a PNG file called "mandelbrot.png" in the same directory.

Customization You can customize the image by changing the following variables in the main.rs file:

  • width: The width of the generated image.
  • height: The height of the generated image.
  • max_iterations: The maximum number of iterations for determining if a point is in the Mandelbrot set or not.

After making changes, run the program again using cargo run.

About

A simple mandelbrot fractal generator in rust.

License:GNU General Public License v3.0


Languages

Language:Rust 100.0%