/src/proj/src/projections/august.cpp
Line | Count | Source (jump to first uncovered line) |
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 | 0 | #define M 1.333333333333333 |
10 | | |
11 | 0 | static PJ_XY august_s_forward(PJ_LP lp, PJ *P) { /* Spheroidal, forward */ |
12 | 0 | PJ_XY xy = {0.0, 0.0}; |
13 | 0 | double t, c1, c, x1, x12, y1, y12; |
14 | 0 | (void)P; |
15 | |
|
16 | 0 | t = tan(.5 * lp.phi); |
17 | 0 | c1 = sqrt(1. - t * t); |
18 | 0 | lp.lam *= .5; |
19 | 0 | c = 1. + c1 * cos(lp.lam); |
20 | 0 | x1 = sin(lp.lam) * c1 / c; |
21 | 0 | y1 = t / c; |
22 | 0 | x12 = x1 * x1; |
23 | 0 | y12 = y1 * y1; |
24 | 0 | xy.x = M * x1 * (3. + x12 - 3. * y12); |
25 | 0 | xy.y = M * y1 * (3. + 3. * x12 - y12); |
26 | 0 | return (xy); |
27 | 0 | } |
28 | | |
29 | 39 | PJ *PJ_PROJECTION(august) { |
30 | 39 | P->inv = nullptr; |
31 | 39 | P->fwd = august_s_forward; |
32 | 39 | P->es = 0.; |
33 | 39 | return P; |
34 | 39 | } |