travis-ci
15 of 15 new or added lines in 1 file covered. (100.0%)
12227 of 15776 relevant lines covered (77.5%)
53653.87 hits per line
1 |
/* Determine latitude angle phi-2. */
|
|
2 |
|
|
3 |
#include <math.h> |
|
4 |
|
|
5 |
#include "projects.h" |
|
6 |
|
|
7 |
static const double TOL = 1.0e-10; |
|
8 |
static const int N_ITER = 15; |
|
9 |
|
|
|
double pj_phi2(projCtx ctx, double ts, double e) { |
244,332✔ |
|
double eccnth = .5 * e; |
244,332✔ |
|
double Phi = M_HALFPI - 2. * atan(ts); |
244,332✔ |
13 |
double con;
|
|
|
int i = N_ITER;
|
244,332✔ |
15 |
|
|
16 |
for(;;) {
|
|
17 |
double dphi;
|
|
|
con = e * sin(Phi); |
1,057,386✔ |
|
dphi = M_HALFPI - 2. * atan(ts * pow((1. - con) / |
2,114,772✔ |
|
(1. + con), eccnth)) - Phi;
|
1,057,386✔ |
21 |
|
|
|
Phi += dphi; |
1,057,386✔ |
23 |
|
|
|
if (fabs(dphi) > TOL && --i)
|
1,057,386✔ |
|
continue;
|
813,054✔ |
|
break;
|
244,332✔ |
|
} |
813,054✔ |
|
if (i <= 0) |
244,332✔ |
|
pj_ctx_set_errno(ctx, PJD_ERR_NON_CON_INV_PHI2); |
× |
|
return Phi;
|
244,332✔ |
31 |
} |