Skip to content

Instantly share code, notes, and snippets.

@mhuebert
Forked from jackrusher/lorentz-mesh.clj
Last active July 13, 2017 14:07
Show Gist options
  • Save mhuebert/562e88d75c04178f1c18ddacc7cff2b7 to your computer and use it in GitHub Desktop.
Save mhuebert/562e88d75c04178f1c18ddacc7cff2b7 to your computer and use it in GitHub Desktop.
(defn lorenz-points [p sigma beta dt]
(loop [n 6000
x 0.01
y 0
z 0
out []]
(if (= 0 n)
out
(recur (dec n)
(+ x (* p (- y x) dt))
(+ y (* (- (* x (- sigma z)) y) dt))
(+ z (* (- (* x y) (* beta z)) dt))
(conj out (vec3 x y z))))))
(-> (lorenz-points 11 28 (/ 8.0 3.0) 0.005)
(thi.ng.geom.ptf/sweep-mesh (g/vertices (circle 0.5) 22)
{:align? false :loop? false})
joggy/set-model!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment