This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmap rgb-color-fractal | |
(let [val % | |
z (.xy val) | |
n (.z val) | |
normalized-count (/ (- n (log2 (log2 (sqrt (+ (* (.x z) (.x z)) (* (.y z) (.y z))))))) | |
(float max-iterations))] | |
(? (< 4.0 (dot z z)) | |
(color3 normalized-count normalized-count (mix 0.2 1.0 normalized-count)) | |
(color3 0.0 0.0 0.0)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmap hsv-color-fractal | |
(let [val % | |
z (.xy val) | |
n (.z val) | |
normalized-count (/ (- n (log2 (log2 (sqrt (+ (* (.x z) (.x z)) (* (.y z) (.y z))))))) | |
(float max-iterations)) | |
h (* 360.0 normalized-count) | |
s 0.8 | |
v 1.0 | |
h_v (floor (/ h 60.0)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user=> (time (nbody/main 100000)) ;;one above | |
(time (nbody/main 100000)) | |
-0.16907516382852444 | |
-0.16907985939166476 | |
"Elapsed time: 2124.75375 msecs" | |
nil | |
user=> (time (main 100000)) ;;; nbody_v2 | |
(time (main 100000)) | |
-0.16907516382852444 |
NewerOlder