-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappendices.tex
50 lines (45 loc) · 1.76 KB
/
appendices.tex
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
\newpage
\appendix
\section{Center computation.}
\begin{algorithm}
\caption{Find the centers of given radius which circumference laid on the two input points.}
\begin{algorithmic}[1]
\Require Radius $\frac{\varepsilon}{2}$ and points $p_1$ and $p_2$.
\Ensure Centers $c_1$ and $c_2$.
\Function{FindCenters}{$p_1$, $p_2$, $\frac{\varepsilon}{2}$}
\State $r^2 \gets (\frac{\varepsilon}{2})^2$
\State $X \gets p_1.x - p_2.x$
\State $Y \gets p_1.y - p_2.y$
\State $d^2 \gets X^2 + Y^2$
\State $R \gets \sqrt{\lvert 4 \times \frac{r^2}{d^2} - 1 \rvert}$
\State $c_1.x \gets X + \frac{Y \times R}{2} + p_2.x$
\State $c_1.y \gets Y - \frac{X \times R}{2} + p_2.y$
\State $c_2.x \gets X - \frac{Y \times R}{2} + p_2.x$
\State $c_2.y \gets Y + \frac{X \times R}{2} + p_2.y$
\State \Return $c_1$ and $c_2$
\EndFunction
\end{algorithmic}
\label{app:centers}
\end{algorithm}
\section{Disk pruning.}
\begin{algorithm}
\caption{Prune disks which are duplicate or subset of others.}
\begin{algorithmic}[1]
\Require Set of disks $D$.
\Ensure Set of disks $D^{\prime}$ without duplicate or subsets.
\Function{PruneDisks}{$D$}
\State $E \gets \varnothing$
\ForAll{disk $d_i$ in $D$}
\State $N \gets d_i \cap D$
\ForAll{disk $n_j$ in $N$}
\If{$d_i$ contains all the elements of $n_j$}
\State $E \gets E \cup {n_j}$
\EndIf
\EndFor
\EndFor
\State $D^{\prime} \gets D \setminus E$
\State \Return $D^{\prime}$
\EndFunction
\end{algorithmic}
\label{app:disks}
\end{algorithm}