code: def dogeo(dec, inc, az, pl):
      
      A1, A2, A3 = [], [], []  # set up lists for rotation vector
      # put dec inc in direction list and set  length to unity
      Dir = [dec, inc, 1.]
      X = dir2cart(Dir)  # get cartesian coordinates
  #
  #   set up rotation matrix
  #
      A1 = dir2cart([az, pl, 1.])
      A2 = dir2cart([az + 90., 0, 1.])
      A3 = dir2cart([az - 180., 90. - pl, 1.])
  #
  # do rotation
  #
      xp = A1[0] * X[0] + A2[0] * X[1] + A3[0] * X[2]
      yp = A1[1] * X[0] + A2[1] * X[1] + A3[1] * X[2]
      zp = A1[2] * X[0] + A2[2] * X[1] + A3[2] * X[2]
  #
  # transform back to dec,inc
  #
      Dir_geo = cart2dir([xp, yp, zp])
      return Dir_geo[0], Dir_geo[1]
docs: Rotates declination and inclination into geographic coordinates using the
      azimuth and plunge of the X direction (lab arrow) of a specimen.
  
      Parameters
      ----------
      dec : declination in specimen coordinates
      inc : inclination in specimen coordinates
  
      Returns
      -------
      rotated_direction : tuple of declination, inclination in geographic coordinates
  
      Examples
      --------
      >>> pmag.dogeo(0.0,90.0,0.0,45.5)
      (180.0, 44.5)