utility.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _LN_UTILITY_H
00020 #define _LN_UTILITY_H
00021
00022 #include <libnova/ln_types.h>
00023
00024 #ifdef __WIN32__
00025 #include <time.h>
00026
00027 #define cbrt(x) pow (x,1.0/3.0)
00028 #endif
00029
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033
00034
00042 const char LIBNOVA_EXPORT * ln_get_version (void);
00043
00053 double LIBNOVA_EXPORT ln_get_dec_location(char *s);
00054
00055
00060 const char LIBNOVA_EXPORT * ln_get_humanr_location(double location);
00061
00062
00063
00064
00065
00066 double LIBNOVA_EXPORT ln_get_rect_distance (struct ln_rect_posn * a, struct ln_rect_posn * b);
00067
00077 double LIBNOVA_EXPORT ln_rad_to_deg (double radians);
00078
00083 double LIBNOVA_EXPORT ln_deg_to_rad (double degrees);
00084
00089 double LIBNOVA_EXPORT ln_hms_to_deg (struct ln_hms * hms);
00090
00095 void LIBNOVA_EXPORT ln_deg_to_hms (double degrees, struct ln_hms * hms);
00096
00101 double LIBNOVA_EXPORT ln_hms_to_rad (struct ln_hms * hms);
00102
00107 void LIBNOVA_EXPORT ln_rad_to_hms (double radians, struct ln_hms * hms);
00108
00113 double LIBNOVA_EXPORT ln_dms_to_deg (struct ln_dms * dms);
00114
00119 void LIBNOVA_EXPORT ln_deg_to_dms (double degrees, struct ln_dms * dms);
00120
00125 double LIBNOVA_EXPORT ln_dms_to_rad (struct ln_dms * dms);
00126
00131 void LIBNOVA_EXPORT ln_rad_to_dms (double radians, struct ln_dms * dms);
00132
00137 void LIBNOVA_EXPORT ln_hequ_to_equ (struct lnh_equ_posn * hpos, struct ln_equ_posn * pos);
00138
00143 void LIBNOVA_EXPORT ln_equ_to_hequ (struct ln_equ_posn * pos, struct lnh_equ_posn * hpos);
00144
00149 void LIBNOVA_EXPORT ln_hhrz_to_hrz (struct lnh_hrz_posn * hpos, struct ln_hrz_posn * pos);
00150
00155 void LIBNOVA_EXPORT ln_hrz_to_hhrz (struct ln_hrz_posn * pos, struct lnh_hrz_posn * hpos);
00156
00161 const char LIBNOVA_EXPORT * ln_hrz_to_nswe (struct ln_hrz_posn * pos);
00162
00167 void LIBNOVA_EXPORT ln_hlnlat_to_lnlat (struct lnh_lnlat_posn * hpos, struct ln_lnlat_posn * pos);
00168
00173 void LIBNOVA_EXPORT ln_lnlat_to_hlnlat (struct ln_lnlat_posn * pos, struct lnh_lnlat_posn * hpos);
00174
00179 void LIBNOVA_EXPORT ln_add_secs_hms (struct ln_hms * hms, double seconds);
00180
00185 void LIBNOVA_EXPORT ln_add_hms (struct ln_hms * source, struct ln_hms * dest);
00186
00191 double LIBNOVA_EXPORT ln_range_degrees (double angle);
00192
00197 double LIBNOVA_EXPORT ln_range_radians (double angle);
00198 double LIBNOVA_EXPORT ln_range_radians2 (double angle);
00199
00200
00201
00202
00203
00204
00205 double LIBNOVA_EXPORT ln_get_light_time (double dist);
00206
00211 double LIBNOVA_EXPORT ln_interpolate3 (double n, double y1, double y2, double y3);
00212
00217 double LIBNOVA_EXPORT ln_interpolate5 (double n, double y1, double y2, double y3, double y4, double y5);
00218
00219 #ifdef __WIN32__
00220
00221
00222 struct tm *gmtime_r (time_t *t, struct tm *gmt);
00223
00224
00225 int gettimeofday(struct timeval *tp, struct timezone *tzp);
00226
00227
00228 char *strtok_r(char *str, const char *sep, char **last);
00229
00230 #endif
00231
00232
00233 #ifdef __C89_SUB__
00234
00235
00236 double cbrt (double x);
00237
00238 #endif
00239
00240 #ifndef HAVE_ROUND
00241
00242
00243 double round (double x);
00244
00245 #endif
00246
00247 #if defined(__WIN32__) || defined(sun) || defined(__C89_SUB__)
00248
00249
00250 double nan (const char *code);
00251
00252 #endif
00253
00254 #ifdef __cplusplus
00255 };
00256 #endif
00257
00258 #endif