Subject: Re: CCL:Inside or outside of a polyhedron

From: [email-masked] (Carlos Simmerling)
Date: Mon, 15 Apr 96 17:23:37 -0700

> Just an idea. It's very efficient, but not sure it's right.
> 
> First transform the current coordinate system to one with the given point 
> (x,y,z) as the origin. I.e. subtrate (xi,yi,zi), where i=1,...,N, by 
> (x,y,z). This can be done very fast.
> 
> Second look at the sign of the transformed coordinates of all vertices. 
> If all xi's, where i=1,...,N, have the same sign, the point is outside 
> of the polyhedron. The statement holds for all yi's or all zi's. So if any 
> one of the three conditions holds, the point will be outside. Otherwise if 
> none of the conditions hold, it's inside.
> 
> 
> Good Luck!
> 
> Rui Luo
> 
While this is a necessary condition for the point to be inside
the polyhedron, it isn't sufficient. A polyhedron that has
a concave portion may span both side of the point without
actually enclosing it. 

=============================================================================
Carlos L. Simmerling, Ph.D.                 
Department of Pharmaceutical Chemistry       Phone: (415) 476-7985 
Box 0446, Room S-926                          Fax:  (415) 476-0688
University of California 
San Francisco, CA 94143                    E-mail: [email-masked]
=============================================================================