aboutsummaryrefslogtreecommitdiff
path: root/Week15 Mandelbrot/src/com/camilstaps/mandelbrot/MandelbrotFractal.java
diff options
context:
space:
mode:
authorCamil Staps2015-06-05 14:22:12 +0200
committerCamil Staps2015-06-05 14:22:12 +0200
commit6928ed87c0a9fa7f746c4331d0a1079d15f09051 (patch)
treeaff3df7dbb53a2ffb3382d36334fcff993947415 /Week15 Mandelbrot/src/com/camilstaps/mandelbrot/MandelbrotFractal.java
parentMerge branch 'master' of github:camilstaps/OO1415 (diff)
Everything works except for multiple swingworkers
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;
}