File Coverage

palsrc/palGeoc.c
Criterion Covered Total %
statement 0 5 0.0
branch n/a
condition n/a
subroutine n/a
pod n/a
total 0 5 0.0


line stmt bran cond sub pod time code
1             /*
2             *+
3             * Name:
4             * palGeoc
5              
6             * Purpose:
7             * Convert geodetic position to geocentric
8              
9             * Language:
10             * Starlink ANSI C
11              
12             * Type of Module:
13             * Library routine
14              
15             * Invocation:
16             * void palGeoc( double p, double h, double * r, double *z );
17              
18             * Arguments:
19             * p = double (Given)
20             * latitude (radians)
21             * h = double (Given)
22             * height above reference spheroid (geodetic, metres)
23             * r = double * (Returned)
24             * distance from Earth axis (AU)
25             * z = double * (Returned)
26             * distance from plane of Earth equator (AU)
27              
28             * Description:
29             * Convert geodetic position to geocentric.
30              
31             * Authors:
32             * PTW: Patrick T. Wallace
33             * TIMJ: Tim Jenness (JAC, Hawaii)
34             * {enter_new_authors_here}
35              
36             * Notes:
37             * - Geocentric latitude can be obtained by evaluating atan2(z,r)
38             * - Uses WGS84 reference ellipsoid and calls eraGd2gc
39              
40             * History:
41             * 2012-03-01 (TIMJ):
42             * Initial version moved from palOne2One
43             * Adapted with permission from the Fortran SLALIB library.
44             * {enter_further_changes_here}
45              
46             * Copyright:
47             * Copyright (C) 2004 Patrick T. Wallace
48             * Copyright (C) 2012 Science and Technology Facilities Council.
49             * All Rights Reserved.
50              
51             * Licence:
52             * This program is free software: you can redistribute it and/or
53             * modify it under the terms of the GNU Lesser General Public
54             * License as published by the Free Software Foundation, either
55             * version 3 of the License, or (at your option) any later
56             * version.
57             *
58             * This program is distributed in the hope that it will be useful,
59             * but WITHOUT ANY WARRANTY; without even the implied warranty of
60             * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
61             * GNU Lesser General Public License for more details.
62             *
63             * You should have received a copy of the GNU Lesser General
64             * License along with this program. If not, see
65             * .
66              
67             * Bugs:
68             * {note_any_bugs_here}
69             *-
70             */
71              
72             #include "pal.h"
73             #include "pal1sofa.h"
74              
75 0           void palGeoc ( double p, double h, double *r, double *z ) {
76             double xyz[3];
77             const double elong = 0.0; /* Use zero longitude */
78             const double AU = 1.49597870E11;
79             /* WGS84 looks to be the closest match */
80 0           eraGd2gc( ERFA_WGS84, elong, p, h, xyz );
81 0           *r = xyz[0] / (AU * cos(elong) );
82 0           *z = xyz[2] / AU;
83 0           }