diff options
author | Mattias Andrée <m@maandree.se> | 2024-10-19 18:21:54 +0200 |
---|---|---|
committer | Mattias Andrée <m@maandree.se> | 2024-10-19 18:21:54 +0200 |
commit | 3ce34980d7ba2bddbf3e9a1bd6f98cbc855bddc2 (patch) | |
tree | 7724cc9cb9c3b2ce5ee60d2e012d1fbeb80aacfb /common.h | |
download | libtellurian-3ce34980d7ba2bddbf3e9a1bd6f98cbc855bddc2.tar.gz libtellurian-3ce34980d7ba2bddbf3e9a1bd6f98cbc855bddc2.tar.bz2 libtellurian-3ce34980d7ba2bddbf3e9a1bd6f98cbc855bddc2.tar.xz |
First commit
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r-- | common.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/common.h b/common.h new file mode 100644 index 0000000..36ca06f --- /dev/null +++ b/common.h @@ -0,0 +1,19 @@ +/* See LICENSE file for copyright and license details. */ +#include "libtellurian.h" + +#include <stddef.h> +#include <math.h> + + +#if __GNUC__ +# pragma GCC diagnostic ignored "-Wunsuffixed-float-constants" +#endif + + +#define radians(DEG) ((double)M_PI / 180.0 * (DEG)) +#define degrees(RAD) (180.0 / (double)M_PI * (RAD)) +#define haversin(X) (fma(-0.5, cos(X), 0.5)) + + +void libtellurian_vincenty_inverse__(double latitude1, double longitude1, double latitude2, double longitude2, + double *distance_out, double *azimuth1_out, double *azimuth2_out); |