Last active
March 7, 2016 15:17
-
-
Save vorce/7d3aa0efee1ce94a9d5d to your computer and use it in GitHub Desktop.
Henon points in clojure https://en.wikipedia.org/wiki/H%C3%A9non_map
This file contains 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
(defn _henon [x y] | |
(let [x1 (* 1.4 (Math/pow x 2))] | |
[(+ y (- 1 x1)), (* x 0.3)])) | |
(defn henon [x y] | |
(let [[hx hy] (_henon x y)] | |
(lazy-seq (cons [hx hy] (henon hx hy))))) | |
; Example usage: (take 100 (henon 1 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment