Examples of how to use comet functions.
#include <stdio.h>
#include <libnova/comet.h>
#include <libnova/julian_day.h>
#include <libnova/rise_set.h>
#include <libnova/transform.h>
#include <libnova/elliptic_motion.h>
void print_date (
char * title,
struct ln_zonedate* date)
{
printf ("\n%s\n",title);
printf (
" Year : %d\n", date->
years);
printf (
" Month : %d\n", date->
months);
printf (
" Day : %d\n", date->
days);
printf (
" Hours : %d\n", date->
hours);
printf (
" Minutes : %d\n", date->
minutes);
printf (
" Seconds : %f\n", date->
seconds);
printf(
"gmtoff %ld\n", date->
gmtoff);
}
int main (int argc, char * argv[])
{
double JD, e_JD;
double E, v, V, r, l, dist;
printf ("JD %f\n", JD);
printf("(Equation of kepler) E when e is 0.1 and M is 5.0 %f\n ", E);
printf("(True Anomaly) v when e is 0.1 and E is 5.5545 %f\n ", v);
printf ("(Radius Vector) r when v is , e is 0.1 and E is 5.5545 %f\n ", r);
printf (
"(Geocentric Rect Coords X) for comet Enckle %f\n", posn.
X);
printf (
"(Geocentric Rect Coords Y) for comet Enckle %f\n", posn.
Y);
printf (
"(Geocentric Rect Coords Z) for comet Enckle %f\n", posn.
Z);
printf (
"(Heliocentric Rect Coords X) for comet Enckle %f\n ", posn.
X);
printf (
"(Heliocentric Rect Coords Y) for comet Enckle %f\n ", posn.
Y);
printf (
"(Heliocentric Rect Coords Z) for comet Enckle %f\n ", posn.
Z);
printf (
"(RA) for comet Enckle %f\n ", equ.
ra);
printf (
"(Dec) for comet Enckle %f\n ", equ.
dec);
printf ("(Orbit Length) for comet Enckle in AU %f\n ", l);
printf ("(Orbit Perihelion Vel) for comet Enckle in kms %f\n ", V);
printf ("(Orbit Aphelion Vel) for comet Enckle in kms %f\n ", V);
printf ("(Orbit Vel JD) for comet Enckle in kms %f\n ", V);
printf ("(Body Solar Dist) for comet Enckle in AU %f\n ", dist);
printf ("(Body Earth Dist) for comet Enckle in AU %f\n ", dist);
printf ("Comet is circumpolar\n");
else {
ln_get_local_date (rst.
rise, &rise);
ln_get_local_date (rst.
transit, &transit);
ln_get_local_date (rst.
set, &
set);
print_date ("Rise", &rise);
print_date ("Transit", &transit);
print_date ("Set", &set);
}
return 0;
}