Coverage Report

Created: 2026-05-16 07:15

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/PROJ/src/projections/wink1.cpp
Line
Count
Source
1
2
3
#include <errno.h>
4
#include <math.h>
5
6
#include "proj.h"
7
#include "proj_internal.h"
8
9
PROJ_HEAD(wink1, "Winkel I") "\n\tPCyl, Sph\n\tlat_ts=";
10
11
namespace { // anonymous namespace
12
struct pj_wink1_data {
13
    double cosphi1;
14
};
15
} // anonymous namespace
16
17
4.36k
static PJ_XY wink1_s_forward(PJ_LP lp, PJ *P) { /* Spheroidal, forward */
18
4.36k
    PJ_XY xy = {0.0, 0.0};
19
4.36k
    xy.x =
20
4.36k
        .5 * lp.lam *
21
4.36k
        (static_cast<struct pj_wink1_data *>(P->opaque)->cosphi1 + cos(lp.phi));
22
4.36k
    xy.y = lp.phi;
23
4.36k
    return (xy);
24
4.36k
}
25
26
0
static PJ_LP wink1_s_inverse(PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
27
0
    PJ_LP lp = {0.0, 0.0};
28
0
    lp.phi = xy.y;
29
0
    lp.lam =
30
0
        2. * xy.x /
31
0
        (static_cast<struct pj_wink1_data *>(P->opaque)->cosphi1 + cos(lp.phi));
32
0
    return (lp);
33
0
}
34
35
81
PJ *PJ_PROJECTION(wink1) {
36
81
    struct pj_wink1_data *Q = static_cast<struct pj_wink1_data *>(
37
81
        calloc(1, sizeof(struct pj_wink1_data)));
38
81
    if (nullptr == Q)
39
0
        return pj_default_destructor(P, PROJ_ERR_OTHER /*ENOMEM*/);
40
81
    P->opaque = Q;
41
42
81
    static_cast<struct pj_wink1_data *>(P->opaque)->cosphi1 =
43
81
        cos(pj_param(P->ctx, P->params, "rlat_ts").f);
44
81
    P->es = 0.;
45
81
    P->inv = wink1_s_inverse;
46
81
    P->fwd = wink1_s_forward;
47
48
81
    return P;
49
81
}