def eci2ecef (x, y, z, gmst=None):
  """Converts the given ECI coordinates to ECEF at the given Greenwich
  Mean Sidereal Time (GMST) (defaults to now).
  
  This code was adapted from
  `shashwatak/satellite-js <https://github.com/shashwatak/satellite-js/blob/master/src/coordinate-transforms.js>`_
  and http://ccar.colorado.edu/ASEN5070/handouts/coordsys.doc

  """
  if gmst is None:
    gmst = dmc.toGMST()

  X = (x * math.cos(gmst))    + (y * math.sin(gmst))
  Y = (x * (-math.sin(gmst))) + (y * math.cos(gmst))
  Z = z

  return X, Y, Z