Are these spheres centered at the Origin? Distance formula is sufficient.
If not, then find the center of the ABC sphere and it's the same problem.
I am working on a 3D Morphing algorithm.
I have a point X on lying on a unit sphere in the spherical coordinate system. I have three other points A,B, and C which are also on the unit sphere.
I need to find out whether X lies on the spherical surface enclosed by A,B, and C or not.
Can any one tell me how to do this?
Thanks a lot in advance.
In Rectangular Coordiantes, the point's address, (x,y,z) are easily used to calculate the distance - or in this case the square fo the distance will be fine - assuming the UNIT sphere is the only measure fo concern.
Distance From Origin =
If that's Greater than 1, it's outside.
I think your only real problem is likely to be precision. Is 1.00000000001 Outside or ON the Unit sphere? You WILL have to make up your mind.
Thanks for the reply. But, you didn't understand the problem at all. All four point lie on the same unit sphere center at the origin. So, ofcourse their distances from the origin will be 1 !
I want to decide whether X lies within the area that is bounded by A,B and C.
I'm new in sphere math world and i have the same problem.
Perhaps I'm wrong or perhaps I don't know how to implement the method of the planes you have decribed previously, but I think you are missing a little surface where you point may lye. If the region enclosed by points A B C is really a triangle (triangulated sphere) there will be no problem(I don't know how to calculate but I guess there will no information missing). But if points do not form a triangle but something like this:
The plane OBC will leave outside the region |).
Correct me if i'm wrong
Yes egvega you are right. And this was the whole problem. Otherwise, finding a point exists within a triangle is not difficult.
The region bounded by the three points will NOT be (and cannot be) triangular on the sphere's surface! Still, the method described by TKHUNNY should work.
You're lucky if it's useful but i'm still trying to solve the problem. The case is that I do care about the region left outside the planes.
I found a way to know where the point is using sphere coordinates theta and phi but when the sphere rotate and the point is fixed, I don't know how to calculate the new region(i give numbers to them) enclosed by other 3 or 4 points where the point lyes. So I was looking for some general algorithm that i can apply no matter which rotation and how many of them I perform on the sphere.