<no title> — CALCEPH - C language 3.4.1 documentation

    int res;
    int j;
    double jd0=2442457;
    double dt1=0.5E0;
    t_calcephbin *peph;
    double PVAJ[12];
    double P[3];

    /* open the ephemeris file */
    peph = calceph_open("example1.dat");
    if (peph)
    {
      /* compute only the heliocentric position of Mars in km */
      calceph_compute_order(peph, jd0, dt1,
                           NAIFID_MARS_BARYCENTER,
                           NAIFID_SUN,
                           CALCEPH_USE_NAIFID+CALCEPH_UNIT_KM
                           +CALCEPH_UNIT_SEC,
                           0, P);
      for(j=0; j<3; j++) printf("%23.16E\n", P[j]);

      /* compute positions, velocities, accelerations and jerks
      of Mars in km and seconds */
      calceph_compute_order(peph, jd0, dt1,
                           NAIFID_MARS_BARYCENTER,
                           NAIFID_SUN,
                           CALCEPH_USE_NAIFID+CALCEPH_UNIT_KM
                           +CALCEPH_UNIT_SEC,
                           3, PVAJ);
      for(j=0; j<12; j++) printf("%23.16E\n", PVAJ[j]);

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