~ubuntu-branches/ubuntu/raring/starlink-pal/raring-proposed

« back to all changes in this revision

Viewing changes to palmac.h

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2012-03-28 11:00:00 UTC
  • Revision ID: package-import@ubuntu.com-20120328110000-9iw40yuy69wuk7po
Tags: upstream-0.1.0
ImportĀ upstreamĀ versionĀ 0.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef PALMACDEF
 
2
#define PALMACDEF
 
3
 
 
4
/*
 
5
*+
 
6
*  Name:
 
7
*     palmac.h
 
8
 
 
9
*  Purpose:
 
10
*     Macros used by the PAL library
 
11
 
 
12
*  Language:
 
13
*     Starlink ANSI C
 
14
 
 
15
*  Type of Module:
 
16
*     Include file
 
17
 
 
18
*  Description:
 
19
*     A collection of useful macros provided and used by the PAL library
 
20
 
 
21
*  Authors:
 
22
*     TIMJ: Tim Jenness (JAC, Hawaii)
 
23
*     {enter_new_authors_here}
 
24
 
 
25
*  Notes:
 
26
*
 
27
 
 
28
*  History:
 
29
*     2012-02-08 (TIMJ):
 
30
*        Initial version.
 
31
*     {enter_further_changes_here}
 
32
 
 
33
*  Copyright:
 
34
*     Copyright (C) 2012 Science and Technology Facilities Council.
 
35
*     All Rights Reserved.
 
36
 
 
37
*  Licence:
 
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.
 
42
*
 
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.
 
47
*
 
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
 
51
*    USA.
 
52
 
 
53
*  Bugs:
 
54
*     {note_any_bugs_here}
 
55
*-
 
56
*/
 
57
 
 
58
/* Pi */
 
59
static const double PAL__DPI = 3.1415926535897932384626433832795028841971693993751;
 
60
 
 
61
/* 2Pi */
 
62
static const double PAL__D2PI = 6.2831853071795864769252867665590057683943387987502;
 
63
 
 
64
/* pi/180:  degrees to radians */
 
65
static const double  PAL__DD2R = 0.017453292519943295769236907684886127134428718885417;
 
66
 
 
67
/* Radians to arcseconds */
 
68
static const double PAL__DR2AS = 2.0626480624709635515647335733077861319665970087963e5;
 
69
 
 
70
/* Arcseconds to radians */
 
71
static const double PAL__DAS2R = 4.8481368110953599358991410235794797595635330237270e-6;
 
72
 
 
73
/* Start of SLA modified Julian date epoch */
 
74
static const double PAL__MJD0 = 2400000.5;
 
75
 
 
76
/* Light time for 1 AU (sec) */
 
77
static const double PAL__CR = 499.004782;
 
78
 
 
79
/* Seconds per day */
 
80
static const double PAL__SPD = 86400.0;
 
81
 
 
82
/* Km per sec to AU per tropical century
 
83
   = 86400 * 36524.2198782 / 149597870 */
 
84
static const double PAL__VF = 21.095;
 
85
 
 
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);
 
89
 
 
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;
 
93
 
 
94
/*  Gaussian gravitational constant (exact) */
 
95
static const double PAL__GCON = 0.01720209895;
 
96
 
 
97
/* DNINT(A) - round to nearest whole number (double) */
 
98
#define DNINT(A) ((A)<0.0?ceil((A)-0.5):floor((A)+0.5))
 
99
 
 
100
/* DMAX(A,B) - return maximum value - evaluates arguments multiple times */
 
101
#define DMAX(A,B) (A > B ? A : B )
 
102
 
 
103
 
 
104
#endif