<no title> — CALCEPH - C language 3.4.1 documentation

    int res;
    int j;
    double jd0=2442457;
    double dt1=0.5E0;
    t_calcephbin *peph;
    double PV[6];

    /* open the ephemeris file */
    peph = calceph_open("example1.dat");
    if (peph)
    {
      /* the heliocentric coordinates of Mars in km and km/s */
      calceph_compute_unit(peph, jd0, dt1, 4, 11,
                           CALCEPH_UNIT_KM+CALCEPH_UNIT_SEC,
                           PV);
      for(j=0; j<6; j++) printf("%23.16E\n", PV[j]);

      /* compute same quantity as the previous call using NAIF ID */
      calceph_compute_unit(peph, jd0, dt1,
                           NAIFID_MARS_BARYCENTER,
                           NAIFID_SUN,
                           CALCEPH_USE_NAIFID+CALCEPH_UNIT_KM
                           +CALCEPH_UNIT_SEC,
                           PV);
      for(j=0; j<6; j++) printf("%23.16E\n", PV[j]);

     /* the heliocentric coordinates of Mars in AU and AU/day */
      calceph_compute_unit(peph, jd0, dt1, 4, 11,
                           CALCEPH_UNIT_AU+CALCEPH_UNIT_DAY,
                           PV);
      for(j=0; j<6; j++) printf("%23.16E\n", PV[j]);

      /* close the ephemeris file */
      calceph_close(peph);
    }