Skip to content

Instantly share code, notes, and snippets.

@chimanaco
Created June 29, 2020 21:52
Show Gist options
  • Save chimanaco/903195428f209a876c3d6311f929c1e0 to your computer and use it in GitHub Desktop.
Save chimanaco/903195428f209a876c3d6311f929c1e0 to your computer and use it in GitHub Desktop.
(background "aliceblue")
(defn mile
{:unit "mi"
:inverse (fn [mi] [(/ mi 1.6)])
}
[km]
(* km 1.6)
)
; (prn (mile 1.5))
; (style (stroke "plum" 3)
; (circle [5 -5.6875] (mile (+ 50 23.519236428298143)))
; )
(defn crosshair
{:handles
{:draw (fn [{:params [center]}]
[{:id :center
:type "point"
:pos center
}]
)
:drag (fn [{:id id :pos mousePos :params [sourcePos]}]
[mousePos]
)
}
}
[center]
(defvar my -89.6875)
(defvar mr 100.02673470752708)
(defvar cx 92)
(defvar cy 15)
(defvar cr 91.04943712072031)
(style
(fill "green")
(path/subtract
(circle [0 my] mr)
(circle [(- cx) cy] cr)
(circle [cx cy] cr)
)
)
)
(crosshair [36 -29.6875])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment