def test_swizzle_3d_012(self): """Swap of a 3D function arguments: identity.""" x, y, z = 4.2, 11, -0.3 swizzled_function = mappers.Swizzle3D(self.function3d, (0, 1, 2)) self.assertAlmostEqual(swizzled_function(x, y, z), self.function3d(x, y, z), places=10)
def test_swizzle_3d_120(self): """Swap of a 3D function arguments: x,y,z -> y,z,x.""" x, y, z = 4.2, 11, -0.3 swizzled_function = mappers.Swizzle3D(self.function3d, (1, 2, 0)) self.assertAlmostEqual(swizzled_function(x, y, z), self.function3d(y, z, x), places=10)
def test_swizzle_3d_201(self): """Swap of a 3D function arguments: x,y,z -> z,x,y.""" x, y, z = 4.2, 11, -0.3 swizzled_function = mappers.Swizzle3D(self.function3d, (2, 0, 1)) self.assertAlmostEqual(swizzled_function(x, y, z), self.function3d(z, x, y), places=10)