aboutsummaryrefslogtreecommitdiff
path: root/Week15 Mandelbrot/src/mandelbrot/ColorChooser.java
diff options
context:
space:
mode:
Diffstat (limited to 'Week15 Mandelbrot/src/mandelbrot/ColorChooser.java')
-rw-r--r--Week15 Mandelbrot/src/mandelbrot/ColorChooser.java36
1 files changed, 0 insertions, 36 deletions
diff --git a/Week15 Mandelbrot/src/mandelbrot/ColorChooser.java b/Week15 Mandelbrot/src/mandelbrot/ColorChooser.java
deleted file mode 100644
index c3aa441..0000000
--- a/Week15 Mandelbrot/src/mandelbrot/ColorChooser.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package mandelbrot;
-
-/**
- *
- * @author Sjaak
- */
-public class ColorChooser {
- private int maxIndex;
-
- public ColorChooser () {
- maxIndex = 0;
- }
-
- public void setMaxIndex (int max_index) {
- maxIndex = max_index;
- }
-
- public int getColorIndex (double x0, double y0) {
- double x = x0, y = y0;
- int color_index = 0;
- while (x * x + y * y < 4.0) {
- double nx = x * x - y * y + x0;
- y = 2 * x * y + y0;
- x = nx;
- color_index++;
- if (color_index == maxIndex) {
- return -1;
- }
- }
- return color_index;
- }
-}