Skip to content

Commit

Permalink
reduce the sample rate as we approach the end of the plot
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Aug 1, 2024
1 parent eef3ea5 commit 353fbe2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/shimmers/sketches/pendulum_sway.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns shimmers.sketches.pendulum-sway
(:require
[clojure.math :as math]
[shimmers.common.sequence :as cs]
[shimmers.common.svg :as csvg :include-macros true]
[shimmers.common.ui.controls :as ctrl]
[shimmers.common.ui.debug :as debug]
Expand Down Expand Up @@ -37,9 +38,10 @@
:beta beta})

(defn plot [{:keys [p r]} {:keys [select-fn] :as params}]
(let [limit 90
(let [limit 100
f (functions select-fn)]
(for [t (range 0 (* limit eq/TAU) 0.05)]
(for [t (cs/range-series 0 (* limit eq/TAU)
(fn [t] (* 0.0225 (math/exp (* 0.003 t)))))]
(gc/circle (tm/+ p (f r t params))
(+ 1.3 (* 0.7
(math/exp (* -0.001 t))
Expand Down

0 comments on commit 353fbe2

Please sign in to comment.