Skip to content

Commit

Permalink
fix: calculate correct part of the xy plane (rust-in-action#29)
Browse files Browse the repository at this point in the history
The wrong part of the parameter space was specified in the book's examples. 
The commit adjusts the parameters to better match the escape time algorithm[1], 

[1] https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Mandelbrot_set
  • Loading branch information
timClicks committed Aug 8, 2021
1 parent 7d7955e commit 153fd44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ch2/ch2-mandelbrot/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ fn render_mandelbrot(escape_vals: Vec<Vec<usize>>) {
}

fn main() {
let mandelbrot = calculate_mandelbrot(1000, 2.0, 1.0, -1.0,

let mandelbrot = calculate_mandelbrot(1000, -2.0, 1.0, -1.0,
1.0, 100, 24);

render_mandelbrot(mandelbrot);
}
}

0 comments on commit 153fd44

Please sign in to comment.