Sweeping the Sphere
Total Page:16
File Type:pdf, Size:1020Kb
Sweeping the Sphere Joao˜ Dinis Margarida Mamede Departamento de F´ısica CITI, Departamento de Informatica´ Faculdade de Ciencias,ˆ Universidade de Lisboa Faculdade de Cienciasˆ e Tecnologia, FCT Campo Grande, Edif´ıcio C8 Universidade Nova de Lisboa 1749-016 Lisboa, Portugal 2829-516 Caparica, Portugal [email protected] [email protected] Abstract—We introduce the first sweep line algorithm for and Hong [5], [6], which is O(n log n) worst case optimal, computing spherical Voronoi diagrams, which proves that where n is the number of sites. An asymptotically slower Fortune’s method can be extended to points on a sphere alternative in the worst case is the randomized incremental surface. This algorithm is similar to Fortune’s plane sweep algorithm, sweeping the sphere with a circular line instead of algorithm of Clarkson and Shor [7], whose expected running a straight one. time is O(n log n). The well-known Quickhull algorithm of Like its planar counterpart, the novel linear-space algorithm Barber et al. [8] can be seen as an efficient variation of the has worst-case optimal running time. Furthermore, it copes previous algorithm. very well with degeneracies and is easy to implement. Experi- A different approach is to adapt the randomized incremen- mental results show that the performance of our algorithm is very similar to that of Fortune’s algorithm, both with synthetic tal algorithm that computes the planar Delaunay triangula- data sets and with real data. tion [9], [10]. The essential operation used in the incremental The usual solutions make use of the connection between step, which checks if a circle defined by three sites contains a convex hulls and spherical Delaunay triangulations. An exper- fourth site, is easily translated into spherical geometry [11], imental comparison revealed that our algorithm outperforms [12]. This algorithm computes the Delaunay triangulation in the freely available implementations that compute convex hulls O(n log n) of point sets in 3D, enabling it to be the preferred choice for expected time. computing Voronoi diagrams on the sphere. The two incremental methods are comparable, since the corresponding incremental steps require a similar effort to Keywords-spherical Voronoi diagrams; sweep algorithms. recompute the part invalidated by the newly added site. This is a consequence of the combinatorial equivalence between I. INTRODUCTION convex hulls and Delaunay triangulations of points on a Voronoi diagrams are one of the most important and useful sphere surface. geometrical data structures that find use in a variety of Another important result, also due to Brown [4], relates fields. Originally defined for point sites in the plane, where the points on the sphere with their stereographic projections proximity is defined by the Euclidean distance, they were on a plane. It is worth mentioning that, whereas Brown made soon generalized to different site shapes, spaces, and metrics use of this property to build Voronoi diagrams in the plane, [1], [2]. Na et al. [13] relied on the inverse relationship and showed One possible generalization, called spherical Voronoi di- how to compute the spherical Voronoi diagram by combining agram, is cast by considering point sites on the surface of a two planar Voronoi diagrams of the projected sites. The sphere and measuring the proximity of two points through latter result works for any compact sites. For point sites, the length of the shortest geodesic arc that joins them [3]. the running time of the algorithm is O(n log n). It is similar to the planar diagram, except that all Voronoi In this work, we study the construction of Voronoi dia- regions are delimited by spherical polygons, whose edges are grams of point sites on the surface of a sphere. We introduce arcs of great circles. These Voronoi diagrams are of special a novel algorithm based on the sweep line technique, using interest in domains where data are inherently spherical, such an approach similar to that of Fortune for the planar case as Earth sciences and astronomy. [14]. More concretely, the spherical Voronoi diagram will The first algorithm for computing the spherical Voronoi be computed by sweeping the sphere with a circular line. diagram makes use of the connection between convex hulls This strategy was previously used by Dehne and Klein [15] and spherical Delaunay triangulations [4], because a facet of to build the Voronoi diagram on a cone surface. However, the convex hull corresponds to a triangle of the Delaunay tri- we shall adopt the variant of the sweep line algorithm of angulation and, therefore, to a vertex of the Voronoi diagram. Guibas and Stolfi [16], preferring the now common wave Several algorithms may be used for that purpose. Brown front construct so as to avoid the deformation transform. [4] suggests the divide and conquer algorithm of Preparata In the plane, the sweep line algorithm is consensually regarded as computationally simple, coping very well with o degeneracies, and easy to implement. As we will see, all these properties also hold in the spherical version. The rest of the paper is organized as follows. The spherical sweep algorithm is specified in Section II. Section II-A starts i examining spherical ellipses, which are needed to define the wave front, studied in Section II-B. Then, in Section II-C a the algorithm is presented and analyzed, and degenerated cases are discussed in Section II-D. Although the algorithm p is defined for the spherical coordinate system, Section II-E is focused on the details of working with Cartesian coordinates. Section III reports on the experimental results: our algorithm is compared, in Section III-A, with two sweep line algo- Figure 1. Spherical ellipse defined by a circle and site a. rithms for computing Voronoi diagrams in the plane and, in Section III-B, with five freely available implementations for computing convex hulls in 3D. Lastly, Section IV concludes center of the sweep, and r ≥ aρ be the radius of the sweep with some comments on the research done in the paper. circle. The loci of points i equidistant to a and to the circle II. SPHERICAL SWEEP define a spherical ellipse, with o and a as focal points and r as major axis (see Fig. 1). This follows from the fact that, for This section is devoted to the algorithm for computing the every i in the conditions stated above, there is a point p on Voronoi diagram on a sphere. It turns out to be an almost the circle such that p i = i a and o i + i p = r. Therefore, straightforward adaptation of the circular sweep algorithm o i + i a = r. The equation of the spherical ellipse, which in the plane [15]. gives the colatitude (i ) of the point of the curve whose Due to its convenience, we make use of the standard ρ longitude is i , is the following (where the arctan function terminology in geography, namely, latitude, colatitude, lon- θ is normalized for positive output): gitude, north and south poles, parallel of latitude, meridian of longitude, prime meridian, and antipode of a site. cos(aρ) − cos(r) First of all, an arbitrary sphere position is chosen to E(a; r; iθ) = arctan : sin(r) − sin(aρ) · cos(aθ − iθ) be the center of the sweep. The sweep circle is always (1) centered at that position and its radius, which is the length Equation (1) shows that the ellipse major axis is aligned of a geodesic arc, starts at zero and increases as the sweep with the site meridian. The ellipse begins degenerated as an process advances. When a site is scanned by the sweep arc of great circle delimited by the foci points, and widens as circle, we are interested in the loci of points equidistant r increases. When r reaches π, the ellipse degenerates into to the site and the circle, which form a spherical ellipse. a great circle, because the sweep circle is the south pole and The outer envelope of all these ellipses constitutes the wave the ellipse is the bisector of two points on the sphere. At front. It is a closed curve made of arcs of ellipse whose that moment, the ellipse has swept half-sphere. intersections scan the edges of the Voronoi diagram. In this The next proposition proves that, since half of the sphere case, since the sphere is a closed domain, the wave front is swept when r varies from aρ to π, the remaining half is disappears when the sweep process comes to an end. swept for r from π to 2π − aρ. Furthermore, the two sweep Although the center of the sweep may be placed at phases are symmetric, in the sense that the ellipse generated any location, we choose the north pole because it greatly for a sweep circle at π + δ is the mirror image of the ellipse simplifies the analysis.1 As a consequence, the sweep circle generated for the sweep circle at π − δ, taking the great scans the parallels of latitude, and its radius is equal to the circle obtained when r = π as the mirror. colatitude of the parallel. The key fact is that the sweep circle Proposition 1: Let a = (aρ; aθ) be a site, o be the north needs to pass over the sphere twice: first from the north pole pole, a∗ and o∗ be the antipodes of a and o, respectively, to the south pole, and then backwards to the north. and δ 2 [0; π − aρ]. The spherical ellipse generated by site A. Spherical Ellipses a when the sweep circle has radius π + δ is the ellipse with foci a∗ and o∗ whose major axis is π − δ.