Coverage Report

Created: 2025-07-23 06:58

/src/PROJ/src/mlfn.cpp
Line
Count
Source (jump to first uncovered line)
1
#include "proj_internal.h"
2
#include <math.h>
3
4
/* meridional distance for ellipsoid and inverse using 6th-order expansion in
5
** the third flattening n.  This gives full double precision accuracy for |f|
6
** <= 1/150.
7
*/
8
9
1.82k
double *pj_enfn(double n) {
10
11
1.82k
    int Lmax = int(AuxLat::ORDER);
12
    // 2*Lmax for the Fourier coeffs for each direction of conversion + 1 for
13
    // overall multiplier.
14
1.82k
    double *en;
15
1.82k
    en = (double *)malloc((2 * Lmax + 1) * sizeof(double));
16
1.82k
    if (nullptr == en)
17
0
        return nullptr;
18
1.82k
    en[0] = pj_rectifying_radius(n);
19
1.82k
    pj_auxlat_coeffs(n, AuxLat::GEOGRAPHIC, AuxLat::RECTIFYING, en + 1);
20
1.82k
    pj_auxlat_coeffs(n, AuxLat::RECTIFYING, AuxLat::GEOGRAPHIC, en + 1 + Lmax);
21
1.82k
    return en;
22
1.82k
}
23
24
17.2k
double pj_mlfn(double phi, double sphi, double cphi, const double *en) {
25
17.2k
  return en[0] * pj_auxlat_convert(phi, sphi, cphi, en + 1);
26
17.2k
}
27
28
0
double pj_inv_mlfn(double mu, const double *en) {
29
0
  int Lmax = int(AuxLat::ORDER);
30
0
  return pj_auxlat_convert(mu / en[0], en + 1 + Lmax);
31
0
}