parameters: (matrix, axes='sxyz')
return_statement: return ax, ay, az
docstring: temporaray import from https://github.com/matthew-brett/transforms3d/blob/master/transforms3d/_gohlketransforms.py for internal use only
docstring_summary: temporaray import from https://github.com/matthew-brett/transforms3d/blob/master/transforms3d/_gohlketransforms.py for internal use only
docstring_tokens: temporaray import from https : // github . com / matthew - brett / transforms3d / blob / master / transforms3d / _gohlketransforms . py for internal use only
function: def _euler_from_matrix(matrix, axes='sxyz'):
      """temporaray import from https://github.com/matthew-brett/transforms3d/blob/master/transforms3d/_gohlketransforms.py for internal use only"""
      try:
          firstaxis, parity, repetition, frame = _AXES2TUPLE[axes.lower()]
      except (AttributeError, KeyError):
          _TUPLE2AXES[axes]  # validation
          firstaxis, parity, repetition, frame = axes
  
      i = firstaxis
      j = _NEXT_AXIS[i+parity]
      k = _NEXT_AXIS[i-parity+1]
  
      M = numpy.array(matrix, dtype=numpy.float64, copy=False)[:3, :3]
      if repetition:
          sy = math.sqrt(M[i, j]*M[i, j] + M[i, k]*M[i, k])
          if sy > _EPS:
              ax = math.atan2( M[i, j],  M[i, k])
              ay = math.atan2( sy,       M[i, i])
              az = math.atan2( M[j, i], -M[k, i])
          else:
              ax = math.atan2(-M[j, k],  M[j, j])
              ay = math.atan2( sy,       M[i, i])
              az = 0.0
      else:
          cy = math.sqrt(M[i, i]*M[i, i] + M[j, i]*M[j, i])
          if cy > _EPS:
              ax = math.atan2( M[k, j],  M[k, k])
              ay = math.atan2(-M[k, i],  cy)
              az = math.atan2( M[j, i],  M[i, i])
          else:
              ax = math.atan2(-M[j, k],  M[j, j])
              ay = math.atan2(-M[k, i],  cy)
              az = 0.0
  
      if parity:
          ax, ay, az = -ax, -ay, -az
      if frame:
          ax, az = az, ax
      return ax, ay, az
function_tokens: def _euler_from_matrix ( matrix , axes = 'sxyz' ) : try : firstaxis , parity , repetition , frame = _AXES2TUPLE [ axes . lower ( ) ] except ( AttributeError , KeyError ) : _TUPLE2AXES [ axes ] # validation firstaxis , parity , repetition , frame = axes i = firstaxis j = _NEXT_AXIS [ i + parity ] k = _NEXT_AXIS [ i - parity + 1 ] M = numpy . array ( matrix , dtype = numpy . float64 , copy = False ) [ : 3 , : 3 ] if repetition : sy = math . sqrt ( M [ i , j ] * M [ i , j ] + M [ i , k ] * M [ i , k ] ) if sy > _EPS : ax = math . atan2 ( M [ i , j ] , M [ i , k ] ) ay = math . atan2 ( sy , M [ i , i ] ) az = math . atan2 ( M [ j , i ] , - M [ k , i ] ) else : ax = math . atan2 ( - M [ j , k ] , M [ j , j ] ) ay = math . atan2 ( sy , M [ i , i ] ) az = 0.0 else : cy = math . sqrt ( M [ i , i ] * M [ i , i ] + M [ j , i ] * M [ j , i ] ) if cy > _EPS : ax = math . atan2 ( M [ k , j ] , M [ k , k ] ) ay = math . atan2 ( - M [ k , i ] , cy ) az = math . atan2 ( M [ j , i ] , M [ i , i ] ) else : ax = math . atan2 ( - M [ j , k ] , M [ j , j ] ) ay = math . atan2 ( - M [ k , i ] , cy ) az = 0.0 if parity : ax , ay , az = - ax , - ay , - az if frame : ax , az = az , ax return ax , ay , az