I have a set of points assigned to a single cluster on a unit sphere. How do I find the boundary of the points on the surface of the sphere? I'm currently using a built-in boundary algorithm in MATLAB, and while it works ok on finding the boundary on a plot of the 2D spherical coordinates theta vs phi (save for wrapping issues between 0 and 360, for example), it fails spectacularly on the 3D Cartesian coordinates x,y,z.
I'm not sure if the problem is: a) I haven't found the right phrases to put into Google to find someone who has already solved the problem and written an algorithm...
or
b) it's a sufficiently minor/unusual procedure that I will have to write an algorithm myself.
Please let me know if I should post this somewhere other than the math forum.
Thanks!
Part of it is that it's a fairly unusual procedure, part of it is that it's a not completely well-defined procedure. When the points are clustered together in one portion of the sphere, a boundary sort of makes sense. But what about a collection of points that are evenly spaced all around the sphere? What should the boundary look like in that case? And how do you tell which points are inside the boundary as opposed to outside it?
I have some ideas as to how to define a "convex hull"-like operation on points on a sphere, in cases when the points are clustered together, which would correspond to MATLAB's "boundary" command with shrink factor $0$. Given two points $p$ and $q$ from your set, there is a unique spherical line through them, given by the equation $(p \times q) \cdot x = 0$. It separates the sphere into two half-planes: $\{x : (p \times q) \cdot x \ge 0\}$ and $\{x : (p \times q) \cdot x \le 0\}$.
When all your points lie in one of those half-planes, it would make sense do declare the line to be a boundary line of your region. Here's roughly what the boundary lines might look like in a nice case:
(You'd want to truncate the boundary lines at the two points they pass through, which I haven't done because figuring out how to draw arcs on a sphere is a pain.)
In a less nice case, you might not be able to find boundaries that connect up to each other, because the would-be interior of your region is big enough to antipodal points. Possibly you could relax the half-plane condition to say that only points close to $p$ and $q$ should be entirely contained in one half-plane? (For some unspecified definition of "close".)
Also, you could always employ the hack of rotating your points so that one of them moves to somewhere the angles won't wrap around, use MATLAB's method to find a boundary for the angles, and then rotate the resulting bounding lines back to the original points on the sphere.