-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathchain-homology.typ
More file actions
59 lines (52 loc) · 1.59 KB
/
Copy pathchain-homology.typ
File metadata and controls
59 lines (52 loc) · 1.59 KB
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
55
56
57
58
59
// Ref. https://normaldeviate.wordpress.com/2012/07/01/topological-data-analysis/
#import "@preview/cetz:0.5.2": canvas, draw
#import draw: bezier, circle, content, line
#set page(width: auto, height: auto, margin: 8pt, fill: none)
#let dr = 0.1
#let stack(x, Cr, Zr, Br) = {
let padding = 0.2
for (name, radius, fill, label) in (
("C", 1.5, luma(192), Cr),
("Z", 1, luma(160), Zr),
("B", 0.5, luma(128), Br),
) {
circle((x, 0), anchor: "south", radius: (radius, radius), fill: fill, name: name)
content(name + ".north", label, anchor: "north", padding: padding)
}
circle((x, 0), anchor: "center", radius: dr, fill: white, name: "zero")
content("zero.south", $0$, anchor: "north", padding: padding)
}
#canvas({
let x = 4
stack(0, $C_(r+1)$, $Z_(r+1)$, $B_(r+1)$)
stack(x, $C_(r)$, $Z_(r)$, $B_(r)$)
stack(2 * x, $C_(r-1)$, $Z_(r-1)$, $B_(r-1)$)
let boundary-labels = ($partial_(r+1)$, $partial_(r)$)
for span in range(2) {
let offset = span * x
let midpoint = offset + 0.5 * x
line((offset + dr, 0), (offset + x - dr, 0), stroke: (dash: "dashed"))
bezier(
(offset, 2),
(offset + x - dr, 0),
(midpoint, 2),
(midpoint, 0),
stroke: (dash: "dashed"),
)
bezier(
(offset, 3),
(offset + x, 1),
(midpoint, 3),
(midpoint, 1),
stroke: (dash: "dashed"),
)
let name = "arrow" + str(1 - span)
line(
(offset + 1, -0.5),
(offset + x - 1, -0.5),
mark: (end: "straight"),
name: name,
)
content(name, boundary-labels.at(span), anchor: "north", padding: 0.1)
}
})