# Checking for a point inside a region of a spherical surface

This topic is 3800 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi everybody, 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. The sphere is centered at the origin. I need to find out whether X lies on the spherical 'triangular' area enclosed by A,B, and C or not. Can any one tell me how to do this? Thanks a lot in advance.

##### Share on other sites
I may not be thinking about this right, but if the point were on the 'triangle', wouldn't it also be on the 'inside' of each of the three planes formed by the sphere center and the triangle vertex pairs?

##### Share on other sites
Quote:
 I need to find out whether X lies on the spherical 'triangular' area enclosed by A,B, and C or not.

I don't know if this is what you mean, but this article explains how to calculate whether a given point is in a triangle:

http://nehe.gamedev.net/data/articles/article.asp?article=10

##### Share on other sites
I've never actually done this, but the answer seems intuitive enough.

Calculate three planes. Each one is defined by three points: 2 of your "spherical triangle" points and the center of your sphere. Have the normals of the planes pointing "inwards" on your spherical triangle. The space inside those three planes defines your spherical triangle. Check your test point against the planes; if it's on the side of the plane where the normal is pointing, it's inside your spherical triangle.

##### Share on other sites
Thanks a lot folks, specially jyk and BeanDog. I understand how to do it now.

1. 1
Rutin
40
2. 2
3. 3
4. 4
5. 5

• 18
• 20
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633363
• Total Posts
3011514
• ### Who's Online (See full list)

There are no registered users currently online

×