Changeset 1063


Ignore:
Timestamp:
Mar 11, 2005, 3:32:51 PM (20 years ago)
Author:
duncan
Message:

extra tests for outside poly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/test_util.py

    r1032 r1063  
    927927        assert outside_polygon( [1.5, 0.5], U )
    928928        #evaluate to True as the point 1.5, 0.5 is outside the unit square
    929        
     929        
    930930        indices = outside_polygon( [[0.5, 0.5], [1, -0.5], [0.3, 0.2]], U )
    931931        assert allclose( indices, [1] )
     
    945945
    946946        assert allclose( res, [0, 4, 5] )       
     947     
     948    def test_outside_polygon2(self):
     949        U = [[0,0], [1,0], [1,1], [0,1]] #Unit square   
     950   
     951        assert not outside_polygon( [0.5, 1.0], U, closed = True )
     952        #evaluate to False as the point 0.5, 1.0 is inside the unit square
    947953       
     954        assert outside_polygon( [0.5, 1.0], U, closed = False )
     955        #evaluate to True as the point 0.5, 1.0 is outside the unit square
    948956
    949957    def test_populate_polygon(self):
Note: See TracChangeset for help on using the changeset viewer.