Techinical ========== There are two main technical concerns in implementing the functions defined previously. - An unbounded region is not directly representable. - Rounding errors need to be handled and/or avoided. Unbounded region ---------------- Given polygon :math:`L`, let :math:`B` be its bounding rectangle, defined by its two opposite points :math:`(x_{0}, y_{0})` and :math:`(x_{1}, y_{1})` where :math:`x_{0} < x_{1}` and :math:`y_{0} < y_{1}`. Additionally, given :math:`e`, in turn, we define :math:`\hat{B}` as a rectangle defined by points :math:`(x_{0} - 4 \rho_{e}, y_{0} - 4 \rho_{e})` and :math:`(x_{1} + 4 \rho_{e}, y_{1} + 4 \rho_{e})`. If we change the definition of :math:`\mathcal{Q}(\mathcal{T})` as .. math:: \begin{align} \mathcal{Q}(\mathcal{T}) := &~ \hat{B} \backslash (N_{\rho_{r}}(\tilde{F}) \cup N_{\rho_{r}}(\tilde{M})) \\ = &~ \{Q_{1}, \cdots, Q_{\sigma(\mathcal{Q})}\}, \end{align} Then we can define :math:`\hat{Q}` of :math:`\mathcal{T}` as the one that includes the point :math:`u := (x_{0} - 2 \rho_{e}, y_{0} - 2 \rho_{e})`. .. note:: The use of constants :math:`2` and :math:`4` is to simplify expressions while avoiding possible rounding errors and/or edge cases. Rounding errors --------------- As for set relations between regions :math:`A, B \subseteq \mathbb{R}^{2}`, it would be preferrable to have :math:`A \subseteq B^{\circ}` instead of :math:`A \subseteq B` whenever possible. Hence, in determining :math:`R_{k}`'s, we actually want as a condition .. math:: R_{k} \subseteq Q^{\circ}. To avoid rounding errors, we further tweak the definitions as the following. .. math:: \begin{align} \mathcal{R}(\mathcal{T}) := &~ L \backslash (N_{\rho_{r} - \varepsilon}(\partial{L}) \cup N_{\rho_{r} - \varepsilon}(\tilde{M})) \\ = &~ \{R_{1}, \cdots, R_{\sigma(\mathcal{R})}\} \\ \mathcal{Q}(\mathcal{T}) := &~ \hat{B} \backslash (N_{\rho_{r} - 2 \varepsilon}(\tilde{F}) \cup N_{\rho_{r} - 2 \varepsilon}(\tilde{M})) \\ = &~ \{Q_{1}, \cdots, Q_{\sigma(\mathcal{Q})}\} \end{align} where :math:`\varepsilon` is some fixed threshold. Although not strictly necessary, for each :math:`i` and :math:`j`, we also alter the definitions of :math:`R_{i}^{*}`'s and :math:`Q_{j}^{*}`'s to .. math:: \begin{align} R_{i}^{*} := &~ N_{\rho_{r} - 3 \varepsilon}(R_{i}) \\ Q_{j}^{*} := &~ N_{\rho_{r} - 3 \varepsilon}(Q_{j}). \end{align}