smbinterp/interp/grid/simplex.py

21 lines
380 B
Python
Raw Normal View History

from interp.baker import get_phis
2010-10-23 12:49:15 -07:00
from interp.tools import log
TOL = 1e-8
def contains(X, R):
"""
tests if X (point) is in R (a simplex,
represented by a list of n-degree coordinates)
2010-10-23 16:06:57 -07:00
it now correctly checks for 2/3-D verts
TODO: write unit test ...
"""
phis = get_phis(X, R)
r = True
if [i for i in phis if i < 0.0 - TOL]:
r = False
return r