self.shape does not equal broadcastable shape

This commit is contained in:
Philip Eisenlohr 2023-08-17 21:10:26 +00:00
parent 71b5b95450
commit fb2d49741a
1 changed files with 2 additions and 1 deletions

View File

@ -307,7 +307,8 @@ class Rotation:
p_m = self.quaternion[...,1:]
q_o = other.quaternion[...,0:1]
p_o = other.quaternion[...,1:]
q = (q_m*q_o - np.einsum('...i,...i',p_m,p_o).reshape(self.shape+(1,)))
qmo = q_m*q_o
q = (qmo - np.einsum('...i,...i',p_m,p_o).reshape(qmo.shape))
p = q_m*p_o + q_o*p_m + _P * np.cross(p_m,p_o)
return self.copy(Rotation(np.block([q,p]))._standardize())
else: