EBSDpython code
Public Member Functions | List of all members
ebsd_Quaternion.Quaternion Class Reference

Detailed Description

Quaternion: mathematical rotation description.


All methods and naming conventions based of http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions
code derived from http://pyeuclid.googlecode.com/svn/trunk/euclid.py
suggested reading: http://web.mit.edu/2.998/www/QuaternionReport1.pdf

w is the real part, (x, y, z) are the imaginary parts

Representation of rotation is in ACTIVE form!
(derived directly or through angleAxis, Euler angles, or active matrix)
vector "a" (defined in coordinate system "A") is actively rotated to new coordinates "b"
b = Q * a
b = np.dot(Q.asMatrix(),a)

Public Member Functions

def __cmp__ (self, other)
 
def __copy__ (self)
 
def __eq__ (self, other)
 
def __getitem__ (self, item)
 
def __init__ (self, quatArray=[1.0)
 
def __iter__ (self)
 
def __ne__ (self, other)
 
def __repr__ (self)
 
GET ROTATION IN DIFFERENT FORMS
def normalized (self)
 
def conjugated (self)
 
def inversed (self)
 
def homomorphed (self)
 
def asList (self)
 
def asM (self)
 
def asMatrix (self)
 
def asAngleAxis (self, degrees=False)
 Returns tuple(angle,axis) More...
 
def asRodrigues (self)
 
def asEulers (self, notation='bunge', degrees=False, standardRange=False, round=8)
 conversion of ACTIVE rotation to Euler angles taken from. More...
 
STATIC CLASS METHODS
def fromIdentity (cls)
 
def fromRandom (cls, randomSeed=None)
 
def fromRodrigues (cls, rodrigues)
 
def fromAngleAxis (cls, angle, axis)
 
def fromEulers (cls, eulers, type='Bunge')
 
def fromMatrix (cls, m)
 Modified Method to calculate Quaternion from Orientation Matrix. More...
 
def new_interpolate (cls, q1, q2, t)
 Interpolation. More...
 

MATHEMATICAL SPECIFIC ROUTINES

def magnitude = __abs__
 
def __pow__ (self, exponent)
 
def __ipow__ (self, exponent)
 
def __mul__ (self, other)
 
def __imul__ (self, other)
 
def __div__ (self, other)
 
def __idiv__ (self, other)
 
def __add__ (self, other)
 
def __iadd__ (self, other)
 
def __sub__ (self, other)
 
def __isub__ (self, other)
 
def __neg__ (self)
 
def __abs__ (self)
 
def magnitude_squared (self)
 
def identity (self)
 
def normalize (self)
 
def conjugate (self)
 
def inverse (self)
 
def homomorph (self)
 

Constructor & Destructor Documentation

◆ __init__()

def ebsd_Quaternion.Quaternion.__init__ (   self,
  quatArray = [1.0 
)

Member Function Documentation

◆ __abs__()

def ebsd_Quaternion.Quaternion.__abs__ (   self)

◆ __add__()

def ebsd_Quaternion.Quaternion.__add__ (   self,
  other 
)

◆ __cmp__()

def ebsd_Quaternion.Quaternion.__cmp__ (   self,
  other 
)

◆ __copy__()

def ebsd_Quaternion.Quaternion.__copy__ (   self)

◆ __div__()

def ebsd_Quaternion.Quaternion.__div__ (   self,
  other 
)

◆ __eq__()

def ebsd_Quaternion.Quaternion.__eq__ (   self,
  other 
)

◆ __getitem__()

def ebsd_Quaternion.Quaternion.__getitem__ (   self,
  item 
)

◆ __iadd__()

def ebsd_Quaternion.Quaternion.__iadd__ (   self,
  other 
)

◆ __idiv__()

def ebsd_Quaternion.Quaternion.__idiv__ (   self,
  other 
)

◆ __imul__()

def ebsd_Quaternion.Quaternion.__imul__ (   self,
  other 
)

◆ __ipow__()

def ebsd_Quaternion.Quaternion.__ipow__ (   self,
  exponent 
)

◆ __isub__()

def ebsd_Quaternion.Quaternion.__isub__ (   self,
  other 
)

◆ __iter__()

def ebsd_Quaternion.Quaternion.__iter__ (   self)

◆ __mul__()

def ebsd_Quaternion.Quaternion.__mul__ (   self,
  other 
)

◆ __ne__()

def ebsd_Quaternion.Quaternion.__ne__ (   self,
  other 
)

◆ __neg__()

def ebsd_Quaternion.Quaternion.__neg__ (   self)

◆ __pow__()

def ebsd_Quaternion.Quaternion.__pow__ (   self,
  exponent 
)

◆ __repr__()

def ebsd_Quaternion.Quaternion.__repr__ (   self)

◆ __sub__()

def ebsd_Quaternion.Quaternion.__sub__ (   self,
  other 
)

◆ asAngleAxis()

def ebsd_Quaternion.Quaternion.asAngleAxis (   self,
  degrees = False 
)

Returns tuple(angle,axis)

◆ asEulers()

def ebsd_Quaternion.Quaternion.asEulers (   self,
  notation = 'bunge',
  degrees = False,
  standardRange = False,
  round = 8 
)

conversion of ACTIVE rotation to Euler angles taken from.

Melcher, A.; Unser, A.; Reichhardt, M.; Nestler, B.; Pötschke, M.; Selzer, M. Conversion of EBSD data by a quaternion based algorithm to be used for grain structure simulations Technische Mechanik 30 (2010) pp 401–413

◆ asList()

def ebsd_Quaternion.Quaternion.asList (   self)

◆ asM()

def ebsd_Quaternion.Quaternion.asM (   self)

◆ asMatrix()

def ebsd_Quaternion.Quaternion.asMatrix (   self)

◆ asRodrigues()

def ebsd_Quaternion.Quaternion.asRodrigues (   self)

◆ conjugate()

def ebsd_Quaternion.Quaternion.conjugate (   self)

◆ conjugated()

def ebsd_Quaternion.Quaternion.conjugated (   self)

◆ fromAngleAxis()

def ebsd_Quaternion.Quaternion.fromAngleAxis (   cls,
  angle,
  axis 
)

◆ fromEulers()

def ebsd_Quaternion.Quaternion.fromEulers (   cls,
  eulers,
  type = 'Bunge' 
)

◆ fromIdentity()

def ebsd_Quaternion.Quaternion.fromIdentity (   cls)

◆ fromMatrix()

def ebsd_Quaternion.Quaternion.fromMatrix (   cls,
  m 
)

Modified Method to calculate Quaternion from Orientation Matrix.

Source http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/

◆ fromRandom()

def ebsd_Quaternion.Quaternion.fromRandom (   cls,
  randomSeed = None 
)

◆ fromRodrigues()

def ebsd_Quaternion.Quaternion.fromRodrigues (   cls,
  rodrigues 
)

◆ homomorph()

def ebsd_Quaternion.Quaternion.homomorph (   self)

◆ homomorphed()

def ebsd_Quaternion.Quaternion.homomorphed (   self)

◆ identity()

def ebsd_Quaternion.Quaternion.identity (   self)

◆ inverse()

def ebsd_Quaternion.Quaternion.inverse (   self)

◆ inversed()

def ebsd_Quaternion.Quaternion.inversed (   self)

◆ magnitude_squared()

def ebsd_Quaternion.Quaternion.magnitude_squared (   self)

◆ new_interpolate()

def ebsd_Quaternion.Quaternion.new_interpolate (   cls,
  q1,
  q2,
  t 
)

Interpolation.

see http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20070017872_2007014421.pdf for (another?) way to interpolate quaternions

◆ normalize()

def ebsd_Quaternion.Quaternion.normalize (   self)

◆ normalized()

def ebsd_Quaternion.Quaternion.normalized (   self)

The documentation for this class was generated from the following file: