Changeset 6304 for branches/numpy/anuga/alpha_shape
- Timestamp:
- Feb 10, 2009, 11:11:04 AM (16 years ago)
- Location:
- branches/numpy
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/numpy/anuga/alpha_shape/alpha_shape.py
r6174 r6304 25 25 from anuga.geospatial_data.geospatial_data import Geospatial_data 26 26 27 import Numericas num27 import numpy as num 28 28 29 29 … … 88 88 raise PointError, "Three points on a straight line" 89 89 90 #Convert input to Numeric arrays91 self.points = num.array(points, num. Float)90 #Convert input to numeric arrays 91 self.points = num.array(points, num.float) 92 92 93 93 … … 288 288 zeroind = [k for k in range(len(denom)) if \ 289 289 (denom[k]< EPSILON and denom[k] > -EPSILON)] 290 try: 291 dx = num.divide_safe(y31*dist21 - y21*dist31,denom) 292 dy = num.divide_safe(x21*dist31 - x31*dist21,denom) 293 except ZeroDivisionError: 294 raise AlphaError 295 290 291 if num.any(denom == 0.0): 292 raise AlphaError 293 294 dx = num.divide(y31*dist21 - y21*dist31, denom) 295 dy = num.divide(x21*dist31 - x31*dist21, denom) 296 296 297 self.triradius = 0.5*num.sqrt(dx*dx + dy*dy) 297 298 #print "triangle radii", self.triradius -
branches/numpy/anuga/alpha_shape/test_alpha_shape.py
r6147 r6304 5 5 import unittest 6 6 7 import Numericas num7 import numpy as num 8 8 9 9 try:
Note: See TracChangeset
for help on using the changeset viewer.