2 bugfixes:

- mixed up other and me when removing quaternion class
- 1000 random orientations are enough for testing
This commit is contained in:
Martin Diehl 2020-01-14 22:30:08 +01:00
parent 18d6d364ec
commit 8a674d0279
2 changed files with 4 additions and 4 deletions

View File

@ -97,9 +97,9 @@ class Rotation:
C = 2.0 * P*self.quaternion[0] C = 2.0 * P*self.quaternion[0]
return np.array([ return np.array([
A*self.quaternion[1] + B*other[0] + C*(self.quaternion[2]*other[2] - self.quaternion[3]*other[1]), A*other[0] + B*self.quaternion[1] + C*(self.quaternion[2]*other[2] - self.quaternion[3]*other[1]),
A*self.quaternion[2] + B*other[1] + C*(self.quaternion[3]*other[0] - self.quaternion[1]*other[2]), A*other[1] + B*self.quaternion[2] + C*(self.quaternion[3]*other[0] - self.quaternion[1]*other[2]),
A*self.quaternion[3] + B*other[2] + C*(self.quaternion[1]*other[1] - self.quaternion[2]*other[0]), A*other[2] + B*self.quaternion[3] + C*(self.quaternion[1]*other[1] - self.quaternion[2]*other[0]),
]) ])
elif other.shape == (3,3,): # rotate a single (3x3)-matrix elif other.shape == (3,3,): # rotate a single (3x3)-matrix
return np.dot(self.asMatrix(),np.dot(other,self.asMatrix().T)) return np.dot(self.asMatrix(),np.dot(other,self.asMatrix().T))

View File

@ -7,7 +7,7 @@ import damask
from damask import Rotation from damask import Rotation
from damask import Orientation from damask import Orientation
n = 100000 n = 1000
@pytest.fixture @pytest.fixture
def default(): def default():