aboutsummaryrefslogtreecommitdiff
path: root/Week15 Mandelbrot/src/com/camilstaps/mandelbrot/MandelbrotFractal.java
diff options
context:
space:
mode:
Diffstat (limited to 'Week15 Mandelbrot/src/com/camilstaps/mandelbrot/MandelbrotFractal.java')
-rw-r--r--Week15 Mandelbrot/src/com/camilstaps/mandelbrot/MandelbrotFractal.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/Week15 Mandelbrot/src/com/camilstaps/mandelbrot/MandelbrotFractal.java b/Week15 Mandelbrot/src/com/camilstaps/mandelbrot/MandelbrotFractal.java
index e0c0520..1c608fd 100644
--- a/Week15 Mandelbrot/src/com/camilstaps/mandelbrot/MandelbrotFractal.java
+++ b/Week15 Mandelbrot/src/com/camilstaps/mandelbrot/MandelbrotFractal.java
@@ -72,7 +72,7 @@ public class MandelbrotFractal {
protected static void calculateMandelNumber(Point p, int repetitions, Result start) {
int n = start.repetitions;
- while (start.x * start.x + start.y * start.y <= 4 && n <= repetitions) {
+ while (start.x * start.x + start.y * start.y <= 4 && n < repetitions) {
double new_x = start.x * start.x - start.y * start.y + p.x;
start.y = 2 * start.x * start.y + p.y;
start.x = new_x;
@@ -114,7 +114,7 @@ public class MandelbrotFractal {
}
protected static class Result {
- int mandelNumber = -1, repetitions = -1;
+ int mandelNumber = -1, repetitions = 0;
double x, y;
}