Ejemplo n.º 1
0
    def test_polygon_area(self):
        """test some polygon_area"""

        assert_almost_equal(polygon_area(self.shp['unit square']),1)
        assert_almost_equal(polygon_area(self.shp['right tri']),0.5)
        assert_almost_equal(polygon_area(self.shp['octahedral tri']),0.8660254)
        assert_almost_equal(polygon_area(self.shp['3D tri']),4.82182538)
Ejemplo n.º 2
0
    def test_polygon_area(self):
        """test some polygon_area"""

        assert_almost_equal(polygon_area(self.shp['unit square']), 1)
        assert_almost_equal(polygon_area(self.shp['right tri']), 0.5)
        assert_almost_equal(polygon_area(self.shp['octahedral tri']),
                            0.8660254)
        assert_almost_equal(polygon_area(self.shp['3D tri']), 4.82182538)
Ejemplo n.º 3
0
def test_m_func_bc_1v1():
    """m_func tests using global vars, i = 0, boundary = 1"""        
    m0 = m_func(0, 1)    
    assert_almost_equal(m0, PTIB[0], 5)
Ejemplo n.º 4
0
def test_m_func_bc_0v1():
    """m_func tests using global vars, i = 0, boundary = 0"""       
        
    m0 = m_func(0, 0)    
    assert_almost_equal(m0, PTPB[0], 5)
Ejemplo n.º 5
0
 def test_bc1(self): 
     """test i = 0, boundary = 1"""
     m0 = m_func(0,1)    
     assert_almost_equal(m0, self.PTIB[0], 5)
Ejemplo n.º 6
0
 def test_bc0(self):
     """test i = 0, boundary = 0"""
     m0 = m_func(0,0)    
     assert_almost_equal(m0, self.PTPB[0], 5)
Ejemplo n.º 7
0
def test_m_from_sin_mx_bc_0v2():
    """m_from_sin_mx tests, self contained, i = 0, boundary = 0"""
    m0 = m_from_sin_mx(0, 0)
    assert_almost_equal(m0, 3.14159, 5)
Ejemplo n.º 8
0
 def test_bc1(self):
     """test i = 0, boundary = 1"""
     m0 = m_func(0, 1)
     assert_almost_equal(m0, self.PTIB[0], 5)
Ejemplo n.º 9
0
def test_m_from_sin_mx_bc_1v2():
    """m_from_sin_mx tests, self contained, i = 0, boundary = 1"""
    m0 = m_from_sin_mx(0, 1)
    assert_almost_equal(m0, 1.57080, 5)
Ejemplo n.º 10
0
def test_m_func_bc_1v2():
    """m_func tests, self contained, i = 0, boundary = 1"""
    m0 = m_func(0, 1)
    assert_almost_equal(m0, 1.57080, 5)
Ejemplo n.º 11
0
def test_m_func_bc_0v2():
    """m_func tests, self contained, i = 0, boundary = 0"""
    m0 = m_func(0, 0)
    assert_almost_equal(m0, 3.14159, 5)
Ejemplo n.º 12
0
def test_m_func_bc_1v1():
    """m_func tests using global vars, i = 0, boundary = 1"""
    m0 = m_func(0, 1)
    assert_almost_equal(m0, PTIB[0], 5)
Ejemplo n.º 13
0
def test_m_func_bc_0v1():
    """m_func tests using global vars, i = 0, boundary = 0"""

    m0 = m_func(0, 0)
    assert_almost_equal(m0, PTPB[0], 5)
Ejemplo n.º 14
0
def test_m_func_bc_0v2():
    """m_func tests, self contained, i = 0, boundary = 0"""        
    m0 = m_func(0, 0)    
    assert_almost_equal(m0, 3.14159, 5)
Ejemplo n.º 15
0
def test_m_from_sin_mx_bc_1v1():
    """m_from_sin_mx tests using global vars, i = 0, boundary = 1"""
    m0 = m_from_sin_mx(0, 1)
    assert_almost_equal(m0, PTIB[0], 5)
Ejemplo n.º 16
0
def test_m_func_bc_1v2():        
    """m_func tests, self contained, i = 0, boundary = 1"""
    m0 = m_func(0, 1)    
    assert_almost_equal(m0, 1.57080, 5)
Ejemplo n.º 17
0
 def test_bc0(self):
     """test i = 0, boundary = 0"""
     m0 = m_func(0, 0)
     assert_almost_equal(m0, self.PTPB[0], 5)