GRASS Programmer's Manual  6.5.svn(2014)-r66266
Go to the documentation of this file.
1 /* TODO:
2
3  Suggestion: all "lon"s in the file "radii.c" should read as "lat"
4
6  on page http://www.mentorsoftwareinc.com/cc/gistips/TIPS0899.HTM
7  down where it says "Meridional Radius of Curvature" is the exact formula
9  Quote: "essentially, the radius of curvature, at a specific latitude ...".
10
12  picture showning the parametric latitude and phi, the geodetic latitude.
13  On the next page,
14  http://williams.best.vwh.net/ellipsoid/node2.html, in equation 3, the
15  Meridional Radius of Curvature shows up.
16
17  So, it looks like you are calculating the Meridional Radius of Curvature
18  as a function of GEODETIC LATITUDE.
19  */
20
21 #include <math.h>
22 #include <grass/gis.h>
23 #include "pi.h"
24
25
26 /****************************************************************
27  Various formulas for the ellipsoid.
28  Reference: Map Projections by Peter Richardus and Ron K. Alder
29  University of Illinois Library Call Number: 526.8 R39m
30  Parameters are:
31  lon = longitude of the meridian
32  a = ellipsoid semi-major axis
33  e2 = ellipsoid eccentricity squared
34
35
36  meridional radius of curvature (p. 16)
37  2
38  a ( 1 - e )
39  M = ------------------
40  2 2 3/2
41  (1 - e sin lon)
42
43  transverse radius of curvature (p. 16)
44
45  a
46  N = ------------------
47  2 2 1/2
48  (1 - e sin lon)
49
50  radius of the tangent sphere onto which angles are mapped
51  conformally (p. 24)
52
53  R = sqrt ( N * M )
54
55 ***************************************************************************/
56
73 double G_meridional_radius_of_curvature(double lon, double a, double e2)
74 {
75  double x;
76  double s;
77
79  x = 1 - e2 * s * s;
80
81  return a * (1 - e2) / (x * sqrt(x));
82 }
83
84
85
102 double G_transverse_radius_of_curvature(double lon, double a, double e2)
103 {
104  double x;
105  double s;
106
108  x = 1 - e2 * s * s;
109
110  return a / sqrt(x);
111 }
112
113
130 double G_radius_of_conformal_tangent_sphere(double lon, double a, double e2)
131 {
132  double x;
133  double s;
134
136  x = 1 - e2 * s * s;
137
138  return a * sqrt(1 - e2) / x;
139 }
double G_radius_of_conformal_tangent_sphere(double lon, double a, double e2)