Last active
June 4, 2024 08:39
-
-
Save alexgian/71b77b05f127c3a42f04b576239a1eaa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns param.example | |
| (:require [emmy.complex :as complex] | |
| [emmy.env :as e :refer :all] | |
| [emmy.mafs :as mafs] | |
| [emmy.mathbox.plot :as plot] | |
| [emmy.viewer :as ev])) | |
| ;; Intersection of two inequalities. | |
| ;; | |
| ;; (note blended color in area of intersection) | |
| (ev/with-let | |
| [!point [-2 -2]] | |
| (mafs/mafs | |
| (mafs/cartesian) | |
| (mafs/inequality | |
| (let [xle (ev/with-params | |
| {:atom !point :params [0 1]} | |
| (fn [ax ay] | |
| (fn [y] | |
| (- (cos (+ y ay)) ax)))) | |
| xgt (ev/with-params | |
| {:atom !point :params [0 1]} | |
| (fn [ax ay] | |
| (fn [y] | |
| (+ (sin (- y ay)) ax))))] | |
| {:x {:<= xle :> xgt} :color :blue})) | |
| (mafs/inequality | |
| (let [yle (ev/with-params | |
| {:atom !point :params [0 1]} | |
| (fn [ax ay] | |
| (fn [x] | |
| (- (cos (+ x ax)) ay)))) | |
| ygt (ev/with-params | |
| {:atom !point :params [0 1]} | |
| (fn [ax ay] | |
| (fn [x] | |
| (+ (sin (- x ax)) ay))))] | |
| {:y {:<= yle :> ygt} :color :pink })) | |
| (mafs/movable-point {:atom !point}) )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment