Changeset 5940


Ignore:
Timestamp:
Nov 11, 2008, 4:02:32 PM (15 years ago)
Author:
rwilson
Message:

Modify the Rajaraman test case.

File:
1 edited

Legend:

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

    r5939 r5940  
    979979        """
    980980
    981         # define 4 *almost* collinear points
    982         #    P1---P2---P3---P4
    983         P1 = [2.0, 2.0]
    984         P2 = [0.0, 0.0]
    985         P3 = [1.0, 1.0]
    986         P4 = [0.0, 0.0]
    987 
    988         self.helper_test_parallel_intersection_code(P1, P2, P3, P4)       
     981        # define 4  collinear points
     982        #
     983        #   Y
     984        #   ^
     985        #   |         x (2,2)
     986        #   |        /
     987        #   |       /
     988        #   |      /
     989        #   |     /
     990        #   |    x (1,1)
     991        #   |   /
     992        #   |  /
     993        #   | /
     994        #   |/
     995        #   x------------>X
     996
     997        line0 = [[2.0, 2.0],[0.0,0.0]]
     998        line1 = [[1.0, 1.0],[0.0,0.0]]
     999
     1000        status, value = intersection(line0, line1)
     1001        print 'status=%s, value=%s' % (str(status), str(value))
     1002       
     1003        self.failIf(status!=2, 'Expected status 2, got status=%s, value=%s' %
     1004                               (str(status), str(value)))
     1005        self.failUnless(allclose(value, [line0[0],line1[1]]))
    9891006
    9901007
Note: See TracChangeset for help on using the changeset viewer.