def test_rotate(self): eq = self.almostEqual solid = Solid() solid.createSphere((0.0, 0.0, 0.0), 1.0) solid.rotate(-pi / 2.0, (0.0, 1.0, 0.0), (1.0, 1.0, 0.0)) eq(solid.centreOfMass(), (1.0, 0.0, -1.0))
def test_translate(self): eq = self.almostEqual solid = Solid() solid.createSphere((0.0, 0.0, 0.0), 1.0) solid.translate((1.0, 2.0, 3.0)) eq(solid.centreOfMass(), (1.0, 2.0, 3.0))
def test_centreOfMass(self): eq = self.almostEqual solid = Solid() solid.createSphere((0.0, 0.0, 0.0), 1.0) eq(solid.centreOfMass(), (0.0, 0.0, 0.0))
def test_rotate(self): eq = self.almostEqual solid = Solid() solid.createSphere((0., 0., 0.), 1.) solid.rotate(-pi / 2., (0., 1., 0.), (1., 1., 0.)) eq(solid.centreOfMass(), (1., 0., -1.))
def test_translate(self): eq = self.almostEqual solid = Solid() solid.createSphere((0., 0., 0.), 1.) solid.translate((1., 2., 3.)) eq(solid.centreOfMass(), (1., 2., 3.))
def test_centreOfMass(self): eq = self.almostEqual solid = Solid() solid.createSphere((0., 0., 0.), 1.) eq(solid.centreOfMass(), (0., 0., 0.))