Skip to content
Browse files

Add scaling and offset parameters

  • Loading branch information...
1 parent a6b7769 commit 2c97e77a2a557e0f8595dc9cc7a1f4f5d7be1a97 @kipanshi committed Dec 25, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/clojure_mandelbrot/core.clj
View
12 src/clojure_mandelbrot/core.clj
@@ -7,15 +7,19 @@
(def image-width 1000)
(def color-depth 65355)
-(def min-re -2.0)
-(def max-re 1.0)
-(def min-im -1.2)
+(def scale-factor 4)
+(def x-offset 1)
+(def y-offset 2)
+
+(def min-re (/ (+ -2.0 x-offset) scale-factor))
+(def max-re (/ (+ 1.0 x-offset) scale-factor))
+(def min-im (/ (+ -1.2 y-offset) scale-factor))
(def max-im (+ min-im (* (- max-re min-re) (/ image-height image-width))))
(def re-factor (/ (- max-re min-re) (- image-width 1)))
(def im-factor (/ (- max-im min-im) (- image-height 1)))
-(def max-iterations 70)
+(def max-iterations 250)
(def background-pixel '(0 0 32000))
(def foreground-pixel '(65355 65355 65355))

0 comments on commit 2c97e77

Please sign in to comment.
Something went wrong with that request. Please try again.