(euler_vec, ordering='ZXZ', full=False)
Returns rotation matrix (or transform) for the given Euler rotations.

  Euler*** methods compose a Rotation matrix corresponding to the given
  rotations r1, r2, r3 following the given rotation ordering. Ordering
  specifies the order of rotation matrices in matrix multiplication order.
  E.g. for XYZ we return rotX(r1) * rotY(r2) * rotZ(r3).

  Args:
    euler_vec: The euler angle rotations.
    ordering: euler angle ordering string (see _euler_orderings).
    full: If true, returns a full 4x4 transfom.

  Returns:
    The rotation matrix or homogenous transform corresponding to the given
    Euler rotation.
Returns rotation matrix (or transform) for the given Euler rotations.
Returns rotation matrix ( or transform ) for the given Euler rotations .
def euler_to_rmat(euler_vec, ordering='ZXZ', full=False):
  """Returns rotation matrix (or transform) for the given Euler rotations.

  Euler*** methods compose a Rotation matrix corresponding to the given
  rotations r1, r2, r3 following the given rotation ordering. Ordering
  specifies the order of rotation matrices in matrix multiplication order.
  E.g. for XYZ we return rotX(r1) * rotY(r2) * rotZ(r3).

  Args:
    euler_vec: The euler angle rotations.
    ordering: euler angle ordering string (see _euler_orderings).
    full: If true, returns a full 4x4 transfom.

  Returns:
    The rotation matrix or homogenous transform corresponding to the given
    Euler rotation.
  """

  # map from partial rotation orderings to rotation functions
  rotmap = {'X': rotation_x_axis, 'Y': rotation_y_axis, 'Z': rotation_z_axis}
  rotations = [rotmap[c] for c in ordering]

  euler_vec = np.atleast_2d(euler_vec)

  rots = []
  for i in range(len(rotations)):
    rots.append(rotations[i](euler_vec[:, i], full))

  if rots[0].ndim == 3:
    result = _batch_mm(_batch_mm(rots[0], rots[1]), rots[2])
    return result.squeeze()
  else:
    return (rots[0].dot(rots[1])).dot(rots[2])
def euler_to_rmat ( euler_vec , ordering = 'ZXZ' , full = False ) : # map from partial rotation orderings to rotation functions rotmap = { 'X' : rotation_x_axis , 'Y' : rotation_y_axis , 'Z' : rotation_z_axis } rotations = [ rotmap [ c ] for c in ordering ] euler_vec = np . atleast_2d ( euler_vec ) rots = [ ] for i in range ( len ( rotations ) ) : rots . append ( rotations [ i ] ( euler_vec [ : , i ] , full ) ) if rots [ 0 ] . ndim == 3 : result = _batch_mm ( _batch_mm ( rots [ 0 ] , rots [ 1 ] ) , rots [ 2 ] ) return result . squeeze ( ) else : return ( rots [ 0 ] . dot ( rots [ 1 ] ) ) . dot ( rots [ 2 ] )