docs: def cross(a, b):
      r"""Cross product of two 3d vectors."""
      if isinstance(a, Mul):
          a = a.expand()
          avect = 1
          aivect = -1
          for ai, fact in enumerate(a.args):
              if isinstance(fact, Vector3D):
                  avect = fact
                  aivect = ai
                  break
  
          acoef = a.args[:aivect] + a.args[aivect+1:]
          acoef = Mul(*acoef)
          return acoef*cross(avect, b)
  
      if isinstance(b, Mul):
          b = b.expand()
          bvect = 1
          bivect = -1
          for bi, fact in enumerate(b.args):
              if isinstance(fact, Vector3D):
                  bvect = fact
                  bivect = bi
                  break
  
          bcoef = b.args[:bivect] + b.args[bivect+1:]
          bcoef = Mul(*bcoef)
          return bcoef*cross(a, bvect)
  
      if isinstance(a, Vector3D) and isinstance(b, Vector3D):
          return CrossProduct(a, b)