class_docstr: A reference frame in classical mechanics.
  
  ReferenceFrame is a class used to represent a reference frame in classical
  mechanics. It has a standard basis of three unit vectors in the frame's
  x, y, and z directions.
  
  It also can have a rotation relative to a parent frame; this rotation is
  defined by a direction cosine matrix relating this frame's basis vectors to
  the parent frame's basis vectors.  It can also have an angular velocity
  vector, defined in another frame.
code: def _dcm(self, parent, parent_orient):
      # If parent.oreint(self) is already defined,then
      # update the _dcm_dict of parent while over write
      # all content of self._dcm_dict and self._dcm_cache
      # with new dcm relation.
      # Else update _dcm_cache and _dcm_dict of both
      # self and parent.
      frames = self._dcm_cache.keys()
      dcm_dict_del = []
      dcm_cache_del = []
      if parent in frames:
          for frame in frames:
              if frame in self._dcm_dict:
                  dcm_dict_del += [frame]
              dcm_cache_del += [frame]
          # Reset the _dcm_cache of this frame, and remove it from the
          # _dcm_caches of the frames it is linked to. Also remove it from
          # the _dcm_dict of its parent
          for frame in dcm_dict_del:
              del frame._dcm_dict[self]
          for frame in dcm_cache_del:
              del frame._dcm_cache[self]
          # Reset the _dcm_dict
          self._dcm_dict = self._dlist[0] = {}
          # Reset the _dcm_cache
          self._dcm_cache = {}
  
      else:
          # Check for loops and raise warning accordingly.
          visited = []
          queue = list(frames)
          cont = True  # Flag to control queue loop.
          while queue and cont:
              node = queue.pop(0)
              if node not in visited:
                  visited.append(node)
                  neighbors = node._dcm_dict.keys()
                  for neighbor in neighbors:
                      if neighbor == parent:
                          warn(
                              "Loops are defined among the orientation of "
                              "frames. This is likely not desired and may "
                              "cause errors in your calculations."
                          )
                          cont = False
                          break
                      queue.append(neighbor)
  
      # Add the dcm relationship to _dcm_dict
      self._dcm_dict.update({parent: parent_orient.T})
      parent._dcm_dict.update({self: parent_orient})
      # Update the dcm cache
      self._dcm_cache.update({parent: parent_orient.T})
      parent._dcm_cache.update({self: parent_orient})
  
imports: from sympy import diff, expand, sin, cos, sympify, eye, zeros, ImmutableMatrix, MatrixBase
  from sympy.core.symbol import Symbol
  from sympy.simplify.trigsimp import trigsimp
  from sympy.physics.vector.vector import Vector, _check_vector
  from sympy.utilities.misc import translate
  from warnings import warn
label_desc: Use image node_id 11 for calling the ReferenceFrame obj's underlying member method code with example usage: obj._dcm(parent, parent_orient) without return types