Skip to content

Commit

Permalink
break equation into parts a little
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Nov 9, 2024
1 parent 8990e69 commit 8a6d9cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/shimmers/sketches/cilia_phase.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
cx' (dr/random)]
{:params {:rx rx :rx' rx' :amp amp :cx cx :cx' cx'}
:fn
(fn [x] (math/sin (* eq/TAU (+ (* rx x) cx (* amp (math/cos (* eq/TAU (+ (* rx' x) cx'))))))))}))
(fn [x] (math/sin (* eq/TAU (+ (* rx x) cx
(* amp (math/cos (* eq/TAU (+ (* rx' x) cx'))))))))}))

(defn cilia-spline-fx []
(let [rx (dr/weighted {1.0 1.0 0.5 1.0 2.0 1.0})
Expand All @@ -40,7 +41,8 @@
cx (dr/random)]
{:params {:rx rx :rx' rx' :amp amp :cx cx}
:fn
(fn [cx' x] (math/sin (* eq/TAU (+ (* rx x) cx (* amp (math/cos (* eq/TAU (+ (* rx' x) cx'))))))))}))
(fn [cx' x] (math/sin (* eq/TAU (+ (* rx x) cx
(* amp (math/cos (* eq/TAU (+ (* rx' x) cx'))))))))}))

(defn screen-space [y amp fx x phase]
(rv x (+ y (* amp (fx (+ x phase))))))
Expand Down

0 comments on commit 8a6d9cb

Please sign in to comment.