Changeset 6001
- Timestamp:
- Nov 26, 2008, 3:29:51 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/polygon.py
r6000 r6001 482 482 483 483 484 def polygon_area( polygon):484 def polygon_area(input_polygon): 485 485 """ Determin area of arbitrary polygon 486 486 Reference … … 489 489 490 490 # Move polygon to origin (0,0) to avoid rounding errors 491 polygon = ensure_numeric(polygon) 492 min_x = min(polygon[:,0]) 493 min_y = min(polygon[:,1]) 494 polygon -= [min_x, min_y] 491 # This makes a copy of the polygon to avoid destroying it 492 input_polygon = ensure_numeric(input_polygon) 493 min_x = min(input_polygon[:,0]) 494 min_y = min(input_polygon[:,1]) 495 polygon = input_polygon - [min_x, min_y] 495 496 496 497 # Compute area
Note: See TracChangeset
for help on using the changeset viewer.