standard name
This commit is contained in:
parent
1a3a4a800e
commit
ebf05a279e
|
@ -311,7 +311,7 @@ class Rotation:
|
||||||
# relax the conventions.
|
# relax the conventions.
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_quaternion(quaternion,
|
def from_quaternion(quaternion,
|
||||||
acceptHomomorph = False,
|
accept_homomorph = False,
|
||||||
P = -1):
|
P = -1):
|
||||||
|
|
||||||
qu = np.array(quaternion,dtype=float)
|
qu = np.array(quaternion,dtype=float)
|
||||||
|
@ -319,7 +319,7 @@ class Rotation:
|
||||||
raise ValueError('Invalid shape.')
|
raise ValueError('Invalid shape.')
|
||||||
|
|
||||||
if P > 0: qu[...,1:4] *= -1 # convert from P=1 to P=-1
|
if P > 0: qu[...,1:4] *= -1 # convert from P=1 to P=-1
|
||||||
if acceptHomomorph:
|
if accept_homomorph:
|
||||||
qu[qu[...,0] < 0.0] *= -1
|
qu[qu[...,0] < 0.0] *= -1
|
||||||
else:
|
else:
|
||||||
if np.any(qu[...,0] < 0.0):
|
if np.any(qu[...,0] < 0.0):
|
||||||
|
@ -472,7 +472,7 @@ class Rotation:
|
||||||
else M + r.asM() * n # noqa add (multiples) of this rotation to average noqa
|
else M + r.asM() * n # noqa add (multiples) of this rotation to average noqa
|
||||||
eig, vec = np.linalg.eig(M/N)
|
eig, vec = np.linalg.eig(M/N)
|
||||||
|
|
||||||
return Rotation.from_quaternion(np.real(vec.T[eig.argmax()]),acceptHomomorph = True)
|
return Rotation.from_quaternion(np.real(vec.T[eig.argmax()]),accept_homomorph = True)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_random(shape=None):
|
def from_random(shape=None):
|
||||||
|
|
Loading…
Reference in New Issue