libnova v 0.15.0

- Main Page
- Related Pages
- Modules
- Data Structures
- Files
- Examples

Functions
General Calendar Functions

## Functions
double | ln_get_julian_day (struct ln_date *date)
| Calculate the julian day from date. More...
void | ln_get_date (double JD, struct ln_date *date)
| Calculate the date from the julian day. More...
unsigned int | ln_get_day_of_week (struct ln_date *date)
| Calculate day of the week. More...
double | ln_get_julian_from_sys ()
| Calculate julian day from system time. More...
void | ln_get_date_from_sys (struct ln_date *date)
| Calculate date from system date. More...
double | ln_get_julian_from_timet (time_t *in_time)
| Calculate julian day from time_t. More...
void | ln_get_timet_from_julian (double JD, time_t *in_time)
| Calculate time_t from julian day. More...
double | ln_get_julian_local_date (struct ln_zonedate *zonedate)
| Calculate Julian day from local date. More...
int | ln_get_date_from_mpc (struct ln_date *date, char *mpc_date)
| Calculate the local date from the a MPC packed date. More...
double | ln_get_julian_from_mpc (char *mpc_date)
| Calculate the julian day from the a MPC packed date. More...

## Detailed Description

## Function Documentation

void ln_get_date | ( | double | JD,
|  | struct ln_date * | date
| ) |  |

Calculate the date from the julian day.

Parameters

  JD | Julian day
  date | Pointer to new calendar date.

Calculate the date from the Julian day

References ln_date::days, ln_date::hours, ln_date::minutes, ln_date::months, ln_date::seconds, and ln_date::years.

Referenced by ln_date_to_zonedate(), and ln_zonedate_to_date().

int ln_get_date_from_mpc | ( | struct ln_date * | date,
|  | char * | mpc_date
| ) |  |

Calculate the local date from the a MPC packed date.

Parameters

  date | Pointer to new calendar date.
  mpc_date | Pointer to string MPC date

Returns
  0 for valid date

Calculate the local date from the a MPC packed date. See http://cfa-www.harvard.edu/iau/info/PackedDates.html for info.

References ln_date::days, ln_date::hours, ln_date::minutes, ln_date::months, ln_date::seconds, and ln_date::years.

Referenced by ln_get_julian_from_mpc().

void ln_get_date_from_sys | ( | struct ln_date * | date | ) |

Calculate date from system date.

Parameters

  date | Pointer to store date.

Calculate local date from system date.

References ln_date::days, ln_date::hours, ln_date::minutes, ln_date::months, ln_date::seconds, and ln_date::years.

Referenced by ln_get_julian_from_sys().

unsigned int ln_get_day_of_week | ( | struct ln_date * | date | ) |

Calculate day of the week.

Parameters

  date | Date required

Returns
  Day of the week

Calculate the day of the week. Returns 0 = Sunday .. 6 = Saturday

References ln_get_julian_day().

double ln_get_julian_day | ( | struct ln_date * | date | ) |

Calculate the julian day from date.

Parameters

  date | Date required.

Returns
  Julian day

Calculate the julian day from a calendar day. Valid for positive and negative years but not for negative JD.

Examples:
  comet.c, and transforms.c.

References ln_date::days, ln_date::hours, ln_date::minutes, ln_date::months, ln_date::seconds, and ln_date::years.

Referenced by ln_date_to_zonedate(), ln_get_day_of_week(), ln_get_julian_from_mpc(), ln_get_julian_from_sys(), ln_get_julian_local_date(), and ln_zonedate_to_date().

double ln_get_julian_from_mpc | ( | char * | mpc_date | ) |

Calculate the julian day from the a MPC packed date.

Parameters

  mpc_date | Pointer to string MPC date

Returns
  Julian day.

Calculate the julian day from the a MPC packed date. See http://cfa-www.harvard.edu/iau/info/PackedDates.html for info.

Examples:
  asteroid.c.

References ln_get_date_from_mpc(), and ln_get_julian_day().

double ln_get_julian_from_sys | ( |  | ) |

Calculate julian day from system time.

Returns
  Julian day (UT)

Calculate the julian day (UT) from the local system time

Examples:
  asteroid.c, comet.c, lunar.c, mars.c, and sun.c.

References ln_get_date_from_sys(), and ln_get_julian_day().

double ln_get_julian_from_timet | ( | time_t * | in_time | ) |

Calculate julian day from time_t.

Parameters

  time | The time_t.

Returns
  Julian day.

Calculate Julian day from time_t.

double ln_get_julian_local_date | ( | struct ln_zonedate * | zonedate | ) |

Calculate Julian day from local date.

Parameters

  zonedate | Local date

Returns
  Julian day (UT)

Calculate Julian day (UT) from zone date

References ln_get_julian_day(), and ln_zonedate_to_date().

void ln_get_timet_from_julian | ( | double | JD,
|  | time_t * | in_time
| ) |  |

Calculate time_t from julian day.

Parameters

  JD | Julian day
  in_time | Pointer to store time_t

Calculate time_t from julian day