Coverage Report

Created: 2024-02-25 06:14

/src/PROJ/src/projections/crast.cpp
Line
Count
Source (jump to first uncovered line)
1
2
#include <math.h>
3
4
#include "proj.h"
5
#include "proj_internal.h"
6
7
PROJ_HEAD(crast, "Craster Parabolic (Putnins P4)") "\n\tPCyl, Sph";
8
9
0
#define XM 0.97720502380583984317
10
0
#define RXM 1.02332670794648848847
11
0
#define YM 3.06998012383946546542
12
0
#define RYM 0.32573500793527994772
13
0
#define THIRD 0.333333333333333333
14
15
0
static PJ_XY crast_s_forward(PJ_LP lp, PJ *P) { /* Spheroidal, forward */
16
0
    PJ_XY xy = {0.0, 0.0};
17
0
    (void)P;
18
0
    lp.phi *= THIRD;
19
0
    xy.x = XM * lp.lam * (2. * cos(lp.phi + lp.phi) - 1.);
20
0
    xy.y = YM * sin(lp.phi);
21
0
    return xy;
22
0
}
23
24
0
static PJ_LP crast_s_inverse(PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
25
0
    PJ_LP lp = {0.0, 0.0};
26
0
    (void)P;
27
0
    lp.phi = 3. * asin(xy.y * RYM);
28
0
    lp.lam = xy.x * RXM / (2. * cos((lp.phi + lp.phi) * THIRD) - 1);
29
0
    return lp;
30
0
}
31
32
48
PJ *PJ_PROJECTION(crast) {
33
48
    P->es = 0.0;
34
48
    P->inv = crast_s_inverse;
35
48
    P->fwd = crast_s_forward;
36
37
48
    return P;
38
48
}