GeographicLib: SphericalHarmonic2.hpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10#if !defined(GEOGRAPHICLIB_SPHERICALHARMONIC2_HPP)
11#define GEOGRAPHICLIB_SPHERICALHARMONIC2_HPP 1
12
13#include
17
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
36 public:
37
38
39
41
42
43
44
45
46
48
49
50
51
52
53
55 };
56
57 private:
61 unsigned _norm;
62
63 public:
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
98 const std::vector& S,
99 int N,
100 const std::vector& C1,
101 const std::vector& S1,
102 int N1,
103 const std::vector& C2,
104 const std::vector& S2,
105 int N2,
106 real a, unsigned norm = FULL)
107 : _a(a)
108 , _norm(norm) {
109 if (!(N1 <= N && N2 <= N))
110 throw GeographicErr("N1 and N2 cannot be larger that N");
114 }
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
155 const std::vector& S,
156 int N, int nmx, int mmx,
157 const std::vector& C1,
158 const std::vector& S1,
159 int N1, int nmx1, int mmx1,
160 const std::vector& C2,
161 const std::vector& S2,
162 int N2, int nmx2, int mmx2,
163 real a, unsigned norm = FULL)
164 : _a(a)
165 , _norm(norm) {
166 if (!(nmx1 <= nmx && nmx2 <= nmx))
167 throw GeographicErr("nmx1 and nmx2 cannot be larger that nmx");
168 if (!(mmx1 <= mmx && mmx2 <= mmx))
169 throw GeographicErr("mmx1 and mmx2 cannot be larger that mmx");
173 }
174
175
176
177
178
179
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
197 const {
198 real f[] = {1, tau1, tau2};
199 real v = 0;
200 real dummy;
201 switch (_norm) {
203 v = SphericalEngine::Value<false, SphericalEngine::FULL, 3>
204 (_c, f, x, y, z, _a, dummy, dummy, dummy);
205 break;
207 default:
208 v = SphericalEngine::Value<false, SphericalEngine::SCHMIDT, 3>
209 (_c, f, x, y, z, _a, dummy, dummy, dummy);
210 break;
211 }
212 return v;
213 }
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
236 real& gradx, real& grady, real& gradz) const {
237 real f[] = {1, tau1, tau2};
238 real v = 0;
239 switch (_norm) {
241 v = SphericalEngine::Value<true, SphericalEngine::FULL, 3>
242 (_c, f, x, y, z, _a, gradx, grady, gradz);
243 break;
245 default:
246 v = SphericalEngine::Value<true, SphericalEngine::SCHMIDT, 3>
247 (_c, f, x, y, z, _a, gradx, grady, gradz);
248 break;
249 }
250 return v;
251 }
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
280 const {
281 real f[] = {1, tau1, tau2};
282 switch (_norm) {
284 return gradp ?
285 SphericalEngine::Circle<true, SphericalEngine::FULL, 3>
286 (_c, f, p, z, _a) :
287 SphericalEngine::Circle<false, SphericalEngine::FULL, 3>
288 (_c, f, p, z, _a);
289 break;
291 default:
292 return gradp ?
293 SphericalEngine::Circle<true, SphericalEngine::SCHMIDT, 3>
294 (_c, f, p, z, _a) :
295 SphericalEngine::Circle<false, SphericalEngine::SCHMIDT, 3>
296 (_c, f, p, z, _a);
297 break;
298 }
299 }
300
301
302
303
306
307
308
311
312
313
316 };
317
318}
319
320#endif
Header for GeographicLib::CircularEngine class.
Header for GeographicLib::Constants class.
GeographicLib::Math::real real
Header for GeographicLib::SphericalEngine class.
Spherical harmonic sums for a circle.
Exception handling for GeographicLib.
Package up coefficients for SphericalEngine.
Spherical harmonic series with two corrections to the coefficients.
Definition SphericalHarmonic2.hpp:35
const SphericalEngine::coeff & Coefficients2() const
Definition SphericalHarmonic2.hpp:314
SphericalHarmonic2(const std::vector< real > &C, const std::vector< real > &S, int N, int nmx, int mmx, const std::vector< real > &C1, const std::vector< real > &S1, int N1, int nmx1, int mmx1, const std::vector< real > &C2, const std::vector< real > &S2, int N2, int nmx2, int mmx2, real a, unsigned norm=FULL)
Definition SphericalHarmonic2.hpp:154
SphericalHarmonic2()
Definition SphericalHarmonic2.hpp:180
CircularEngine Circle(real tau1, real tau2, real p, real z, bool gradp) const
Definition SphericalHarmonic2.hpp:279
const SphericalEngine::coeff & Coefficients() const
Definition SphericalHarmonic2.hpp:304
SphericalHarmonic2(const std::vector< real > &C, const std::vector< real > &S, int N, const std::vector< real > &C1, const std::vector< real > &S1, int N1, const std::vector< real > &C2, const std::vector< real > &S2, int N2, real a, unsigned norm=FULL)
Definition SphericalHarmonic2.hpp:97
const SphericalEngine::coeff & Coefficients1() const
Definition SphericalHarmonic2.hpp:309
Math::real operator()(real tau1, real tau2, real x, real y, real z) const
Definition SphericalHarmonic2.hpp:196
normalization
Definition SphericalHarmonic2.hpp:40
@ SCHMIDT
Definition SphericalHarmonic2.hpp:54
@ FULL
Definition SphericalHarmonic2.hpp:47
Math::real operator()(real tau1, real tau2, real x, real y, real z, real &gradx, real &grady, real &gradz) const
Definition SphericalHarmonic2.hpp:235
Namespace for GeographicLib.