summaryrefslogtreecommitdiff
path: root/sduacm2017/lec3/lec.tex
blob: 990c6e5a4237ff664d4a63ba828cb5af9f158a69 (plain) (blame)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
\documentclass[aspectratio=169,hyperref={pdfencoding=auto,psdextra}]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{CJKutf8}
\usepackage{ulem}
\usepackage{graphicx}
\usepackage{fancyvrb}
\usepackage{amsmath}
\usepackage{multicol}
\usetheme{Malmoe}
\usecolortheme{default}
\begin{CJK*}{UTF8}{gbsn}
\title{「初中数学都不会」}
\subtitle{——Computational Geometrics}
\author{Chris Xiong}
\date{2017-08-18}
\begin{document}
	\frame{\titlepage}
	\begin{frame}
		\frametitle{「初中数学都不会」}
		\framesubtitle{Outline}
		\begin{itemize}
			\item Basics
			\begin{itemize}
				\item Vectors
				\item Distances
				\item Area
				\item Intersections
				\item Transformations
			\end{itemize}
			\item Convex hull
			\item Extra fun
			\item Templates
			\item 殴打宇宙智障
		\end{itemize}
	\end{frame}
	\begin{frame}
		\frametitle{Basics}
		\framesubtitle{Vectors}
		\begin{itemize}
			\item Computational Gemoetrics in ICPC=\\
					\hspace{1cm}40\% Junior high school maths+\\
					\hspace{1cm}30\% Senior high school maths+\\
					\hspace{1cm}20\% Brainstorming+\\
					\hspace{1cm}10\% College maths
			\item $\mathbf{u}$, $\mathbf{v}$, $\vec{u}$, $\vec{v}$
			\item $\vec{u}+\vec{v}$,$\vec{u}-\vec{v}$,$s\vec{u}$,$\vec{u}\cdot\vec{v}$,$\vec{u}\times\vec{v}$
		\end{itemize}
	\end{frame}
	\begin{frame}
		\frametitle{Basics}
		\framesubtitle{Distances}
		\begin{itemize}
			\item point 2 point
			\item point 2 line
			\pause
			\item polygon 2 polygon???
		\end{itemize}
	\end{frame}
	\begin{frame}
		\frametitle{Basics}
		\framesubtitle{Area}
		\begin{itemize}
			\item Circle???
			\item Triangle?
				\begin{itemize}
					\item \sout{$ah/2$}
					\item Heron's formula
					\item Cross product
				\end{itemize}
			\item Polygon???
				\begin{itemize}
					\item Slicing
				\end{itemize}
		\end{itemize}
	\end{frame}
	\begin{frame}
		\frametitle{Basics}
		\framesubtitle{Intersections}
		\begin{itemize}
			\item point \& line
			\item point \& segment
			\item line \& line
			\item line \& segment
			\item segment \& segment
			\item circle \& line
			\item circle \& circle
			\pause
			\item \sout{convex} polygon \& point \pause
				\begin{itemize}
					\item \sout{randomizing} (polyhedron)
					\item ray casting
					\item winding number
				\end{itemize}
		\end{itemize}
	\end{frame}
	\begin{frame}
		\frametitle{Basics}
		\framesubtitle{Transformations}
		\begin{itemize}
			\item Scaling
			\item Rotation
			\item ${\displaystyle {\begin{bmatrix}s_x&0\\0&s_y\end{bmatrix}}}$
			\item ${\displaystyle {{\begin{bmatrix}\cos \theta &\sin \theta \\-\sin \theta &\cos \theta \end{bmatrix}}}}$
		\end{itemize}
	\end{frame}
	\begin{frame}
		\frametitle{Convex hull}
		\framesubtitle{WTF???}
		\begin{itemize}
			\item Smallest convex polygon (set) that contains a set of points.
		\end{itemize}
	\end{frame}
	\begin{frame}
		\frametitle{Convex hull}
		\framesubtitle{Algorithms}
		\begin{itemize}
			\item Brute force: gift wrapping
			\item Graham scan
		\end{itemize}
	\end{frame}
	\begin{frame}
		\frametitle{Convex hull}
		\framesubtitle{Gift wrapping}
		\begin{itemize}
			\item The left most point must be in the resulting set
			\item Starting from that point, select the next point such that
			all points are \textbf{to the right} of the newly formed line.
			\item Time complexity: $O(nh)$
		\end{itemize}
	\end{frame}
	\begin{frame}
		\frametitle{Convex hull}
		\framesubtitle{Graham scan}
		\begin{itemize}
			\item Find an extreme point and sort the remaining point according
			to polar angle.
			\item Start with a stack with two items, the extreme point and the
			first point in the sorted list.
			\item ($P_0$ denotes the top element of the stack, $P_1$ denotes the
			element under $P_0$) For each point left in the list ($T$), pop the
			stack until $\overrightarrow{P_1P_0}$ and $\overrightarrow{P_0T}$ forms
			\textbf{a left turn}. Then push $T$ onto the stack.
			\item Time complexity: $O(n log n)$ (with sorting)
		\end{itemize}
	\end{frame}
	\begin{frame}
		\frametitle{Convex hull}
		\framesubtitle{Example: NEERC 08 A}
	\end{frame}
	\begin{frame}
		\frametitle{Extra fun}
		\framesubtitle{Example: PetrSU SC 04 C}
		Arc-arc intersection
		\includegraphics[scale=0.5]{c1.png}
	\end{frame}
	\begin{frame}
		\frametitle{Extra fun}
		\framesubtitle{Example: PetrSU SC 04 C}
		\includegraphics[scale=0.36]{c2.png}
	\end{frame}
	\begin{frame}
		\frametitle{Extra fun}
		\framesubtitle{Example: MultiUniversity Traning 20170815 H}
	\end{frame}
	\begin{frame}
		\frametitle{Extra fun}
		\framesubtitle{Example: Asia GuangzhouRC 14 H}
	\end{frame}
	\begin{frame}
		\frametitle{Extra fun}
		\framesubtitle{Example: "Angry birds"}
		One of the few problems of computational geometrics in ICPC
		that involves college maths.
	\end{frame}
	\begin{frame}
		\frametitle{Extra fun}
		\framesubtitle{CG. Combined with other algorithms}
	\end{frame}
	\begin{frame}
		\frametitle{Extra fun}
		\framesubtitle{Rotating calipers}
		Solves:
		\begin{itemize}
			\item Max/min width of convex polygon
			\item Max/min distance between two convex polygons
			\item Antipodal points/Farthest pairs
			\item Union/intersection of convex polygons
			\item Min area/perimeter obb
			\item etc.
		\end{itemize}
	\end{frame}
	\begin{frame}
		\frametitle{Templates}
		\framesubtitle{Critical for Computational Geometrics (maybe)}
		\begin{itemize}
			\item Basic operations
			\item Basic intersections
			\item Circle-line intersection
			\item Circle-triangle intersection
			\item Circle-circle intersection
			\item 3D vector operations
			\item Half-plane intersection
			\item Cloest/Farthest Pair
			\item etc.
		\end{itemize}
	\end{frame}
	\begin{frame}
		\frametitle{殴打宇宙智障}
		\framesubtitle{光辉事迹+1}
		\begin{itemize}
			\item 建完图后把图清空然后跑网络流\pause
			\item 熟悉你的模板\pause
			\item 多校睡觉\pause
			\item 队伍组成
			\item 代码手?\pause
			\item 违反中央八项规定\pause
			\item 口技
		\end{itemize}
	\end{frame}
	\begin{frame}
		\frametitle{殴打宇宙智障}
		\framesubtitle{后事}
		\begin{itemize}
			\item 21日最后一次讲课
			\item 8月31日计科退宿舍
			\item 如有不同以宇宙智障为准
		\end{itemize}
	\end{frame}
	\begin{frame}
		\frametitle{殴打宇宙智障}
		\framesubtitle{没来得及讲的东西}
		\begin{itemize}
			\item 概率(解方程/dp)、高斯消元
			\item 网络流
			\item 好像没什么了?
			\item Good luck to ya.
		\end{itemize}
	\end{frame}
\end{CJK*}
\end{document}