GRASS 8 Programmer's Manual 8.6.0dev(2026)-c83afef6d3
Loading...
Searching...
No Matches
radii.c
Go to the documentation of this file.
1/*!
2 \file lib/gis/radii.c
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
8 Comments:
9 on page http://www.mentorsoftwareinc.com/cc/gistips/TIPS0899.HTM
10 down where it says "Meridional Radius of Curvature" is the exact formula
11 out of "radii.c".
12 Quote: "essentially, the radius of curvature, at a specific latitude ...".
13
14 See also http://williams.best.vwh.net/ellipsoid/node1.html which has a nice
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 SPDX-FileCopyrightText: 2001-2009 GRASS Development Team
54 SPDX-License-Identifier: GPL-2.0-or-later
55
56 \author CERL
57 */
58
59#include <math.h>
60#include <grass/gis.h>
61#include "pi.h"
62
63/*!
64 * \brief Meridional radius of curvature
65 *
66 * Returns the meridional radius of curvature at a given longitude:
67 *
68 \f$
69 \rho = \frac{a (1-e^2)}{(1-e^2\sin^2 lon)^{3/2}}
70 \f$
71 *
72 * \param lon longitude
73 * \param a ellipsoid semi-major axis
74 * \param e2 ellipsoid eccentricity squared
75 *
76 * \return radius value
77 */
78double G_meridional_radius_of_curvature(double lon, double a, double e2)
79{
80 double x;
81 double s;
82
83 s = sin(Radians(lon));
84 x = 1 - e2 * s * s;
85
86 return a * (1 - e2) / (x * sqrt(x));
87}
88
89/*!
90 * \brief Transverse radius of curvature
91 *
92 * Returns the transverse radius of curvature at a given longitude:
93 *
94 \f$
95 \nu = \frac{a}{(1-e^2\sin^2 lon)^{1/2}}
96 \f$
97 *
98 * \param lon longitude
99 * \param a ellipsoid semi-major axis
100 * \param e2 ellipsoid eccentricity squared
101 *
102 * \return radius value
103 */
104double G_transverse_radius_of_curvature(double lon, double a, double e2)
105{
106 double x;
107 double s;
108
109 s = sin(Radians(lon));
110 x = 1 - e2 * s * s;
111
112 return a / sqrt(x);
113}
114
115/*!
116 * \brief Radius of conformal tangent sphere
117 *
118 * Returns the radius of the conformal sphere tangent to ellipsoid at
119 * a given longitude:
120 *
121 \f$
122 r = \frac{a (1-e^2)^{1/2}}{(1-e^2\sin^2 lon)}
123 \f$
124 *
125 * \param lon longitude
126 * \param a ellipsoid semi-major axis
127 * \param e2 ellipsoid eccentricity squared
128 *
129 * \return radius value
130 */
131double G_radius_of_conformal_tangent_sphere(double lon, double a, double e2)
132{
133 double x;
134 double s;
135
136 s = sin(Radians(lon));
137 x = 1 - e2 * s * s;
138
139 return a * sqrt(1 - e2) / x;
140}
#define Radians(x)
Definition pi.h:6
double G_meridional_radius_of_curvature(double lon, double a, double e2)
Meridional radius of curvature.
Definition radii.c:78
double G_transverse_radius_of_curvature(double lon, double a, double e2)
Transverse radius of curvature.
Definition radii.c:104
double G_radius_of_conformal_tangent_sphere(double lon, double a, double e2)
Radius of conformal tangent sphere.
Definition radii.c:131
#define x