/src/PROJ/src/projections/august.cpp
Line | Count | Source |
1 | | |
2 | | |
3 | | #include <math.h> |
4 | | |
5 | | #include "proj.h" |
6 | | #include "proj_internal.h" |
7 | | |
8 | | PROJ_HEAD(august, "August Epicycloidal") "\n\tMisc Sph, no inv"; |
9 | 7.05k | #define M 1.333333333333333 |
10 | | |
11 | 3.52k | static PJ_XY august_s_forward(PJ_LP lp, PJ *P) { /* Spheroidal, forward */ |
12 | 3.52k | PJ_XY xy = {0.0, 0.0}; |
13 | 3.52k | double t, c1, c, x1, x12, y1, y12; |
14 | 3.52k | (void)P; |
15 | | |
16 | 3.52k | t = tan(.5 * lp.phi); |
17 | 3.52k | c1 = sqrt(1. - t * t); |
18 | 3.52k | lp.lam *= .5; |
19 | 3.52k | c = 1. + c1 * cos(lp.lam); |
20 | 3.52k | x1 = sin(lp.lam) * c1 / c; |
21 | 3.52k | y1 = t / c; |
22 | 3.52k | x12 = x1 * x1; |
23 | 3.52k | y12 = y1 * y1; |
24 | 3.52k | xy.x = M * x1 * (3. + x12 - 3. * y12); |
25 | 3.52k | xy.y = M * y1 * (3. + 3. * x12 - y12); |
26 | 3.52k | return (xy); |
27 | 3.52k | } |
28 | | |
29 | 109 | PJ *PJ_PROJECTION(august) { |
30 | 109 | P->inv = nullptr; |
31 | 109 | P->fwd = august_s_forward; |
32 | 109 | P->es = 0.; |
33 | 109 | return P; |
34 | 109 | } |