# Analytical Solution for the Problem of Point Location in Arbitrary Planar Domains
## 9 Discussion and Conclusions  
This paper presents a methodology to solve, in analytical form, the problem of point inclusion in planar domains for regions of virtually unlimited complexity, namely with boundary curves of order greater than linear segments. Specifically, for the cases for regions bounded arbitrarily by polygonal, circular arcs and Bezier lines have been derived and implemented, and the methodology for regions with other shapes has been described and is ready to be applied to the general algorithm. The approaches described are handled in analytical form, so they are independent of any numerical approximations, hence independent of scale. Nonetheless, when performing actual calculations in floating point operations, the limitation of the numeric representation of the computational system naturally occurs. However, due to the nature of the operations (sums and multiplications in the Algorithms 3 and 4 for polygonal regions only), the propagation of uncertainty is minimal, and operations can even be performed in integer representation, which is suitable for some embedded systems. On the other hand, this is not the case for the general approach of non-linear segments (covered in Algorithm 5) because boundary segments are non-linear, and non-linear calculations are required, including trigonometric or root operations. Since the accumulated chain of non-linear operations is short, uncertainty propagation is contained, and results have shown that very good accuracy (in 12 or more decimal places) is kept in the final outcome. This can be checked, for example, by \"zooming\" into the plots extensively and verifying the correct result of point inclusion. The mentioned GitHub repository allows these tests to be performed by other users. The paper also demonstrates why a simple winding number based technique for detecting point inclusion will always be ambiguous if the testing point is on the border. Nonetheless, the proposed algorithms detect those situations early, and the technique relies on the need of a single pass operation, i.e., it requires no iterative procedure or further verifications. Besides this advantage of a single operation, the possibility of extending the algorithm to regions of more complex shapes opens wider directions in the field of simulation and computational geometry. The usage for curves of high orders needs to deal with negative real axis intersection, which is equivalent to finding the roots of polynomials or other transcendental curves. This implies unavoidable additional computational costs when compared to straight polygonal shapes. Nevertheless, the pure analytical formulation of the method may remain an advantage against the alternatives of linearization or approximation of curves to polygonal lines. Along these lines, a final remark is worth mentioning, which concerns a potential alternative to this approach for general shapes. We could think of the possibility of triangulating a region such as the ones shown in Figure 19 and apply point location techniques cited in Section 2. Although the technique is usually applied for a problem not addressed in this paper, a region could be triangulated and the test of inclusion of a point in the overall region could be performed by identifying which subregion, if any, includes that point. Besides the variable computational costs of this extreme solution, two main limitations immediately arise. The first is concerning self-intersecting regions and regions with holes (like the ones in Figure 10) that require additional care and pre-processing to be triangulated. Secondly, and even more relevant, if the region boundaries are curved, they must be linearized (sampled) to perform the triangulation. This has two drawbacks: the computational demands of the preprocessing and an additional computational cost that depends on the scale.