Skip to content

Commit 153fd44

Browse files
authored
fix: calculate correct part of the xy plane (#29)
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
1 parent 7d7955e commit 153fd44

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ch2/ch2-mandelbrot/src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ fn render_mandelbrot(escape_vals: Vec<Vec<usize>>) {
7070
}
7171

7272
fn main() {
73-
let mandelbrot = calculate_mandelbrot(1000, 2.0, 1.0, -1.0,
73+
74+
let mandelbrot = calculate_mandelbrot(1000, -2.0, 1.0, -1.0,
7475
1.0, 100, 24);
7576

7677
render_mandelbrot(mandelbrot);
77-
}
78+
}

0 commit comments

Comments
 (0)