-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
coordinates.cljs
54 lines (35 loc) · 1.74 KB
/
coordinates.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
(ns mafs.coordinates
(:require ["mafs" :as m]))
(defn Cartesian
"Takes an (optional) options map `opts` and renders a cartesian coordinate plane
into the Mafs scene.
Supported options:
- `:x-axis`: `false` to disable the axis, or an axis options map (see below).
- `:y-axis`: `false` to disable the axis, or an xis options map (see below).
- `:subdivisions`: How many subdivisions to draw per line as a default for
both axes, or `false` to draw none.
Supported axis options:
- `:axis`: boolean that specifies whether or not to draw the axis line.
- `:lines`: The spacing between each primary line orthogonal to the axis, or
false to draw none.
- `:subdivisions`: How many subdivisions to draw per line, or `false` to draw
none.
- `:labels`: A quoted ClojureScript function that returns a label for each
line, or [[mafs.core/labelPi]]. "
([] [:> (.-Cartesian m/Coordinates)])
([opts] [:> (.-Cartesian m/Coordinates) opts]))
(defn Polar
"Takes an (optional) options map `opts` and renders a polar coordinate plane
into the Mafs scene.
Supported options:
- `:x-axis`: `false` to disable the axis, or an axis options map (see below).
- `:y-axis`: `false` to disable the axis, or an xis options map (see below).
- `:lines`: The spacing between each radial line, or false to draw none.
- `:subdivisions`: How many subdivisions to draw per line as a default for
both axes, or `false` to draw none.
Supported axis options:
- `:axis`: boolean that specifies whether or not to draw the axis line.
- `:labels`: A quoted ClojureScript function that returns a label for each
line, or [[mafs.core/labelPi]]. "
([] [:> (.-Polar m/Coordinates)])
([opts] [:> (.-Polar m/Coordinates) opts]))