10
* Macros used by the PAL library
19
* A collection of useful macros provided and used by the PAL library
22
* TIMJ: Tim Jenness (JAC, Hawaii)
23
* {enter_new_authors_here}
31
* {enter_further_changes_here}
34
* Copyright (C) 2012 Science and Technology Facilities Council.
35
* All Rights Reserved.
38
* This program is free software; you can redistribute it and/or
39
* modify it under the terms of the GNU General Public License as
40
* published by the Free Software Foundation; either version 3 of
41
* the License, or (at your option) any later version.
43
* This program is distributed in the hope that it will be
44
* useful, but WITHOUT ANY WARRANTY; without even the implied
45
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
46
* PURPOSE. See the GNU General Public License for more details.
48
* You should have received a copy of the GNU General Public License
49
* along with this program; if not, write to the Free Software
50
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
54
* {note_any_bugs_here}
59
static const double PAL__DPI = 3.1415926535897932384626433832795028841971693993751;
62
static const double PAL__D2PI = 6.2831853071795864769252867665590057683943387987502;
64
/* pi/180: degrees to radians */
65
static const double PAL__DD2R = 0.017453292519943295769236907684886127134428718885417;
67
/* Radians to arcseconds */
68
static const double PAL__DR2AS = 2.0626480624709635515647335733077861319665970087963e5;
70
/* Arcseconds to radians */
71
static const double PAL__DAS2R = 4.8481368110953599358991410235794797595635330237270e-6;
73
/* Start of SLA modified Julian date epoch */
74
static const double PAL__MJD0 = 2400000.5;
76
/* Light time for 1 AU (sec) */
77
static const double PAL__CR = 499.004782;
80
static const double PAL__SPD = 86400.0;
82
/* Km per sec to AU per tropical century
83
= 86400 * 36524.2198782 / 149597870 */
84
static const double PAL__VF = 21.095;
86
/* Radians per year to arcsec per century. This needs to be a macro since it
87
is an expression including other constants. */
88
#define PAL__PMF (100.0*60.0*60.0*360.0/PAL__D2PI);
90
/* Mean sidereal rate - the rotational angular velocity of Earth
91
in radians/sec from IERS Conventions (2003). */
92
static const double PAL__SR = 7.2921150e-5;
94
/* Gaussian gravitational constant (exact) */
95
static const double PAL__GCON = 0.01720209895;
97
/* DNINT(A) - round to nearest whole number (double) */
98
#define DNINT(A) ((A)<0.0?ceil((A)-0.5):floor((A)+0.5))
100
/* DMAX(A,B) - return maximum value - evaluates arguments multiple times */
101
#define DMAX(A,B) (A > B ? A : B )