Skip to content

Instantly share code, notes, and snippets.

@wikka
Last active June 22, 2017 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wikka/e749442b3acf87f74790c83b2ef01a63 to your computer and use it in GitHub Desktop.
Save wikka/e749442b3acf87f74790c83b2ef01a63 to your computer and use it in GitHub Desktop.
(defn heart-coords []
(for [t (range (-(Math/PI)) (Math/PI) 0.01)] ; the circumference
(let [x (* 16 (Math/pow (Math/sin t) 3)) ; x = 16 sin3 t
y (- (* 13 (Math/cos t)) ; y = 13 cos t -
(* 5 (Math/cos (* 2 t))) ; 5 cos(2 t) -
(* 2 (Math/cos (* 3 t))) ; 2 cos(3 t) -
(Math/cos (* 4 t))) ; cos(4 t)
z 0
tp (/ (+ t 3) 6.1)
r (Math/sin (* tp Math/PI))
g 0
b 0]
(union
(->> (sphere 2)
(color [r g b 1])
(translate [x y z]))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment