
/g,">").replace(/"/g,""").replace(/'/g,"'")}let o={},d=[];function c(n,e,t){o={...o,dynamic:n,core:e,leinProject:t}}function m(){d=["wh","with-style"]}window.onload=()=>{let{dynamic:e,core:t,leinProject:a}=o;if(e&&(document.getElementById("code-dynamic").innerHTML=l(e)),t&&(document.getElementById("code-core").innerHTML=l(t)),a&&(document.getElementById("code-lein-project").innerHTML=l(a)),d){let n={wh:';; Copyright (c) 2016 Tyler Hobbs\n;; MIT License\n;; https://github.com/thobbs/genartlib/\n(defn h\n "Returns a given percentage of the height Quil-specific."\n ([] (h 1.0))\n ([percentage] (* (height) percentage)))\n\n;; Copyright (c) 2016 Tyler Hobbs\n;; MIT License\n;; https://github.com/thobbs/genartlib/\n(defn w\n "Returns a given percentage of the width. Quil-specific."\n ([] (w 1.0))\n ([percentage] (* (width) percentage)))\n',"with-style":"(defmacro with-style [& body]\n `(do\n (q/push-style)\n (try\n ~@body\n (finally (q/pop-style)))))\n"},e=d.map(e=>n[e]).join("\n");document.getElementById("code-helpers").innerHTML=l(e)}n(r).addPlugin((0,s.number)()),n(r).highlightAll()}}),s("3PmhV",function(n,t){e(n.exports,"number",()=>a);let a=n=>({"after:highlightElement":({el:n,result:e,text:t})=>{let a=e.value.split("\n");a.pop();let r=a.length.toString().length,i=a.map((n,e)=>{let t=(e+1).toString().padStart(r);return`${n}`}).join("\n");n.innerHTML=i}})}),i("d3dEA"),i("7Y8VX");var l=i("dZ8Um");(0,l.make)("(ns sketch.dynamic\n (:require ; [clojure.java.shell :refer [sh]]\n [genartlib.algebra :refer :all]\n ; [genartlib.curves :refer :all]\n ; [genartlib.geometry :refer :all]\n ; [genartlib.random :refer :all]\n ; [kdtree :as kd]\n [clojure.core.matrix :as mat]\n [artlib.quil.global :refer :all]\n [genartlib.util :refer [w h]]\n [quil.core :as q]))\n\n(defn make-bogdanov-map [sigma k mu]\n (fn [[x y]] \n (let [yn (+ y (* sigma y) (* k x (- x 1)) (* mu x y))\n xn (+ x yn)]\n [xn yn])))\n\n(def to-draw (atom []))\n\n(defn draw [state]\n (let [frame (:frame state)\n f (/ frame 300)\n\n sigma (+ 1e-6 (* 1e-6 (Math/cos (* f Math/PI 2))))\n k (+ 1.2 (* 5e-5 (Math/sin (* f Math/PI 2))))\n ;; mu (+ 1e-4 (* 1e-6 (Math/cos (* f Math/PI 2))))\n\n ;; sigma 1e-10\n ;; k 1.2\n mu 5e-4\n bogdanov (make-bogdanov-map sigma k mu)\n \n y0 (+ 0.2 (* 1e-5 (Math/cos (* f Math/PI 2))))\n x0 (+ 0.5 (* 1e-1 (Math/sin (* f Math/PI 2))))\n points (->> (iterate bogdanov [x0 y0])\n (take 90000)\n (filter (fn [[x y]] (and (< (abs x) 0.8) (< (abs y) 0.8)))))\n\n x-min -0.6 ;;(apply min (map first points))\n x-max 0.8 ;;(apply max (map first points))\n y-min -0.65 ;;(apply min (map second points))\n y-max 0.7 ;;(apply max (map second points))\n x-range (- x-max x-min)\n y-range (- y-max y-min)\n\n padding 0.03\n padding2 (- 1 (* padding 2))\n\n points (->> points \n (map (fn [[x y]]\n (let [xn (/ (- x x-min) x-range)\n yn (/ (- y y-min) y-range)\n\n xn (+ (* xn padding2) padding)\n yn (+ (* yn padding2) padding)]\n [xn yn])))\n (filter #(> 0.6 (mat/distance % [0.5 0.5]))))\n \n \n new-list (vec (cons points @to-draw))\n new-list (if (< (count new-list) 10) new-list (pop new-list))\n \n max-std 0.002\n iters 5]\n (reset! to-draw new-list)\n\n (q/background 0 50 4)\n (with-style\n (q/no-fill)\n (q/stroke-weight (w 0.001))\n (doseq [[idx points] (map-indexed vector (reverse @to-draw))]\n (dotimes [n iters]\n (let [hue (gauss 40 3)\n alpha (- 0.2 (* idx 0.001))\n sat (+ 10 (* 10 (q/noise n (* f 10))))]\n (q/stroke hue sat 100 alpha)\n (doseq [[x y] points]\n (let [std (- max-std (* max-std (/ n iters)))]\n (q/point (w (gauss x std)) (h (gauss y std)))))))))))\n\n",'(ns sketch.core\n (:require [artlib.quil.middleware :refer [animation-mode]]\n [clojure.core.matrix :refer [set-current-implementation]]\n [quil.middleware :as qm]\n [sketch.dynamic :as dynamic]\n [quil.core :as q]))\n\n(set-current-implementation :vectorz)\n(println)\n\n(q/defsketch example\n :title "genuary-2024-08"\n :setup (fn [] {})\n :draw dynamic/draw\n :update identity\n :size [1080 1080]\n :animation {:render? true :dirname "1"}\n :middleware [qm/fun-mode animation-mode])\n\n','(defproject genuary-2024-08 "0.1.0-SNAPSHOT"\n :description "FIXME: write description"\n :url "https://example.com/FIXME"\n :license {:name "Apache License, Version 2.0"\n :url "https://www.apache.org/licenses/LICENSE-2.0.html"}\n :dependencies [[org.clojure/clojure "1.11.1"]\n [com.dedovic/artlib-core "0.0.10"]\n [genartlib/genartlib "0.1.21"]] ; utility functions\n :jvm-opts ["-Xms4000m" "-Xmx4000M" ; 4GB heap size\n "-server"\n "-Dsun.java2d.uiScale=1.0"] ; adjust scaling for high DPI displays\n :source-paths ["src/clj"]\n :java-source-paths ["src/java"]\n :resource-paths ["resources"])\n'),(0,l.withDefaultHelpers)();
dynamic.clj
core.clj
helpers
project.clj