
Interpolation on the surface of a sphere
13 次查看(过去 30 天)
显示 更早的评论
context:
I wrote a function to "uniformly" distribute points on the surface of a sphere/globe... I put a point at each pole, and then divided the rest of the east north space into latitude bands where the width/height of the latitude band is proportional to the number of points in it and the number of latitude bands and points in each latitude band is chosen to make make the east-west spacing roughly equal to the north-south spacing, and then I rotate each band independently to maximize the minimum longitude difference of any two points in consecutive latitude bands, and then I do a single spherical CVT (Centroidal Voronoi Tessellation) step to slightly improve the spacing of points. To do the CVT I use convhulln to get the delaunay tessellation of the surface of the sphere and compute the 1 Voronoi cell vertex per triangle, fractional area of each triangle that belongs to each of its nodes along with the centroid of the fractional areas, which I can add up (weighted by the fractional areas) to get the updated point positions. (the first CVT step improves the spacing then it decreases) anyway I'm getting a min/max point area ratio of about .91 which isn't a minimum energy/maxi-min design but it is quite close and it takes a second or less to generate. Using the point areas as weights in an integration also makes it a quite accurate at integrating a function over a sphere (getting between 3 and 5 sig figs of accuracy for O(1000) points, when the standard deviations equals the mean for the test function with an analytical solution).
That's context... put another way I DON'T have a rectangular grid of points on an east-west north-south map.
I would like to unwrap the function from the sphere onto an east north map, and I figured out the logic for a piece wise (triangle wise) constant unwrapping/flattening of sphere (which was the most complicated part of all of this, much more complicated than the point generation) and this meant that edges of the triangles would come out as curves on the map.
But really it would look a lot better (and be simpler) if I took an TP grid of lat long points on the map, translated them to xyz (on the surface of the sphere) points, identified the triangles on the sphere that contained those xyz points, did barycentric interpolation there, and then used those values with the "original" Tensor Product lat long coordinates to display the map.
The part I'm missing is a tsearchn equivalent for identifying which triangles on the sphere contain the xyz points; I am not a qhull expert, so what I would write would be no-where nearly as fast as the tsearchn function is. I was hoping that someone out there had already solved this.
Back when tsearchn was slow (took O(3) minutes for a few thousand points in O(6) dimensions), I wrote a replacement that took about a minute by using a space-filling curve as a short cut to restrict the number of triangles that I needed to check, and then using a simplex/neighbor based search, but shortly thereafter MATHWORKS released a update based on qhull that managed it in a few seconds, so like I said a qhull based (or similar) approach is going to be about 2 orders of magnitude faster than what I would write using my SFC+simplex approach.
0 个评论
回答(2 个)
John D'Errico
2013-12-24
It depends on your goals in the end. It sounds like you are trying to do a numerical integration over a sphere from one comment, and this is just a means to an end.
For example, I have written tools that can work with a simplicial complex in any number of dimensions. One of the pieces can generate a triangulated tiling of a 3-sphere.
>> sc = tilesphere(1,30,12)
sc =
domain: [292x3 double]
tessellation: [580x3 double]
range: [292x0 double]
>> plotsc(sc)

A nice feature of these tools is they are also capable of a gaussian integration of some general function over that domain, where you can specify the order of the gaussian rule. This would easily yield far more than a few significant digits of accuracy. I've also written adaptive integration rules like quad, but in several dimensions, but I've never really been happy with them. (One day I'll finish them.)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spatial Search 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!