1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
use crate*;
/*
** - - - - - - - - - -
** e r a G d 2 g c e
** - - - - - - - - - -
**
** Transform geodetic coordinates to geocentric for a reference
** ellipsoid of specified form.
**
** Given:
** a double equatorial radius (Notes 1,4)
** f double flattening (Notes 2,4)
** elong double longitude (radians, east +ve)
** phi double latitude (geodetic, radians, Note 4)
** height double height above ellipsoid (geodetic, Notes 3,4)
**
** Returned:
** xyz double[3] geocentric vector (Note 3)
**
** Returned (function value):
** int status: 0 = OK
** -1 = illegal case (Note 4)
** Notes:
**
** 1) The equatorial radius, a, can be in any units, but meters is
** the conventional choice.
**
** 2) The flattening, f, is (for the Earth) a value around 0.00335,
** i.e. around 1/298.
**
** 3) The equatorial radius, a, and the height, height, must be
** given in the same units, and determine the units of the
** returned geocentric vector, xyz.
**
** 4) No validation is performed on individual arguments. The error
** status -1 protects against (unrealistic) cases that would lead
** to arithmetic exceptions. If an error occurs, xyz is unchanged.
**
** 5) The inverse transformation is performed in the function
** eraGc2gde.
**
** 6) The transformation for a standard ellipsoid (such as ERFA_WGS84) can
** more conveniently be performed by calling eraGd2gc, which uses a
** numerical code to identify the required a and f values.
**
** References:
**
** Green, R.M., Spherical Astronomy, Cambridge University Press,
** (1985) Section 4.5, p96.
**
** Explanatory Supplement to the Astronomical Almanac,
** P. Kenneth Seidelmann (ed), University Science Books (1992),
** Section 4.22, p202.
*/