GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r72735
Go to the documentation of this file.
1 /*!
3
4  \brief GIS Library - Calculating the Meridional Radius of Curvature
5
6  \todo Suggestion: all "lon"s in the file "radii.c" should read as "lat"
7
9  on page http://www.mentorsoftwareinc.com/cc/gistips/TIPS0899.HTM
10  down where it says "Meridional Radius of Curvature" is the exact formula
12  Quote: "essentially, the radius of curvature, at a specific latitude ...".
13
15  picture showning the parametric latitude and phi, the geodetic latitude.
16  On the next page,
17  http://williams.best.vwh.net/ellipsoid/node2.html, in equation 3, the
18  Meridional Radius of Curvature shows up.
19
20  So, it looks like you are calculating the Meridional Radius of Curvature
21  as a function of GEODETIC LATITUDE.
22
23  Various formulas for the ellipsoid.
24  Reference: Map Projections by Peter Richardus and Ron K. Alder
25  University of Illinois Library Call Number: 526.8 R39m
26  Parameters are:
27  - lon = longitude of the meridian
28  - a = ellipsoid semi-major axis
29  - e2 = ellipsoid eccentricity squared
30
31
32  meridional radius of curvature (p. 16)
33  \verbatim
34  2
35  a ( 1 - e )
36  M = ------------------
37  2 2 3/2
38  (1 - e sin lon)
39  \endverbatim
40  transverse radius of curvature (p. 16)
41  \verbatim
42  a
43  N = ------------------
44  2 2 1/2
45  (1 - e sin lon)
46  \endverbatim
47  radius of the tangent sphere onto which angles are mapped
48  conformally (p. 24)
49  \verbatim
50  R = sqrt ( N * M )
51  \endverbatim
52
53  (C) 2001-2009 by the GRASS Development Team
54
55  This program is free software under the GNU General Public License
56  (>=v2). Read the file COPYING that comes with GRASS for details.
57
58  \author CERL
59  */
60
61 #include <math.h>
62 #include <grass/gis.h>
63 #include "pi.h"
64
65 /*!
66  * \brief Meridional radius of curvature
67  *
68  * Returns the meridional radius of curvature at a given longitude:
69  *
70  \f$71 \rho = \frac{a (1-e^2)}{(1-e^2\sin^2 lon)^{3/2}} 72 \f$
73  *
74  * \param lon longitude
75  * \param a ellipsoid semi-major axis
76  * \param e2 ellipsoid eccentricity squared
77  *
79  */
80 double G_meridional_radius_of_curvature(double lon, double a, double e2)
81 {
82  double x;
83  double s;
84
86  x = 1 - e2 * s * s;
87
88  return a * (1 - e2) / (x * sqrt(x));
89 }
90
91 /*!
92  * \brief Transverse radius of curvature
93  *
94  * Returns the transverse radius of curvature at a given longitude:
95  *
96  \f$97 \nu = \frac{a}{(1-e^2\sin^2 lon)^{1/2}} 98 \f$
99  *
100  * \param lon longitude
101  * \param a ellipsoid semi-major axis
102  * \param e2 ellipsoid eccentricity squared
103  *
105  */
106 double G_transverse_radius_of_curvature(double lon, double a, double e2)
107 {
108  double x;
109  double s;
110
112  x = 1 - e2 * s * s;
113
114  return a / sqrt(x);
115 }
116
117 /*!
118  * \brief Radius of conformal tangent sphere
119  *
120  * Returns the radius of the conformal sphere tangent to ellipsoid at
121  * a given longitude:
122  *
123  \f$124 r = \frac{a (1-e^2)^{1/2}}{(1-e^2\sin^2 lon)} 125 \f$
126  *
127  * \param lon longitude
128  * \param a ellipsoid semi-major axis
129  * \param e2 ellipsoid eccentricity squared
130  *
132  */
133 double G_radius_of_conformal_tangent_sphere(double lon, double a, double e2)
134 {
135  double x;
136  double s;
137
139  x = 1 - e2 * s * s;
140
141  return a * sqrt(1 - e2) / x;
142 }
double G_radius_of_conformal_tangent_sphere(double lon, double a, double e2)