/src/PROJ/src/projections/wag7.cpp
Line | Count | Source |
1 | | |
2 | | |
3 | | #include <math.h> |
4 | | |
5 | | #include "proj.h" |
6 | | #include "proj_internal.h" |
7 | | |
8 | | PROJ_HEAD(wag7, "Wagner VII") "\n\tMisc Sph, no inv"; |
9 | | |
10 | 139k | static PJ_XY wag7_s_forward(PJ_LP lp, PJ *P) { /* Spheroidal, forward */ |
11 | 139k | PJ_XY xy = {0.0, 0.0}; |
12 | | |
13 | 139k | (void)P; /* Shut up compiler warnings about unused P */ |
14 | | |
15 | 139k | xy.y = 0.90630778703664996 * sin(lp.phi); |
16 | 139k | const double theta = asin(xy.y); |
17 | 139k | const double ct = cos(theta); |
18 | 139k | lp.lam /= 3.; |
19 | 139k | xy.x = 2.66723 * ct * sin(lp.lam); |
20 | 139k | const double D = 1 / (sqrt(0.5 * (1 + ct * cos(lp.lam)))); |
21 | 139k | xy.y *= 1.24104 * D; |
22 | 139k | xy.x *= D; |
23 | 139k | return (xy); |
24 | 139k | } |
25 | | |
26 | 762 | PJ *PJ_PROJECTION(wag7) { |
27 | 762 | P->fwd = wag7_s_forward; |
28 | 762 | P->inv = nullptr; |
29 | 762 | P->es = 0.; |
30 | 762 | return P; |
31 | 762 | } |