public static function Gd2gc(iauRefEllips $n, $elong, $phi, $height,
          array &$xyz) {

    $j;
    $a;
    $f;

    /* Obtain reference ellipsoid parameters. */
    $j = IAU::Eform($n, $a, $f);

    /* If OK, transform longitude, geodetic latitude, height to x,y,z. */
    if ($j == 0) {
      $j = IAU::Gd2gce($a, $f, $elong, $phi, $height, $xyz);
      if ($j != 0)
        $j = -2;
    }

    /* Deal with any errors. */
    if ($j != 0)
      IAU::Zp($xyz);

    /* Return the status. */
    return $j;
  }