Ignore:
Timestamp:
Mar 17, 2009, 11:06:55 PM (16 years ago)
Author:
ole
Message:

Wrote is_inside_triangle in C and tested it some more.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/utilities/polygon.py

    r6534 r6535  
    188188def is_inside_triangle(point, triangle,
    189189                       closed=True,
    190                        rtol=1.0e-6,
    191                        atol=1.0e-8,                     
     190                       rtol=1.0e-12,
     191                       atol=1.0e-12,                     
    192192                       check_inputs=True,
    193193                       verbose=False):
     
    228228   
    229229    rtol and atol will determine how close the point has to be to the edge
    230     before it is deemed on the edge.
     230    before it is deemed to be on the edge.
    231231   
    232232    """
     
    246246    if point[1] > max(triangle[:,1]): return False       
    247247
    248    
     248    return bool(_is_inside_triangle(point, triangle, int(closed), rtol, atol))
     249   
     250   
     251
     252    # FIXME (Ole): The rest of this function has been made
     253    # obsolete by the C extension
     254       
    249255    # Start search   
    250256    A = triangle[0, :]
     
    282288                                 Y[0], Y[1],
    283289                                 rtol, atol)
     290           
    284291            if res:
    285292                return True
    286293               
    287                
     294    return False
    288295
    289296
     
    12331240    from polygon_ext import _separate_points_by_polygon
    12341241    from polygon_ext import _interpolate_polyline   
     1242    from polygon_ext import _is_inside_triangle       
    12351243    #from polygon_ext import _intersection
    12361244
Note: See TracChangeset for help on using the changeset viewer.