Module common

Module common 

Source
Expand description

Common functions for all projections

Enums§

AuxLat
List of auxiliary latitudes

Functions§

_msfn
Compute the meridian scale factor
aacos
Adjusted ArcCosine
aasin
Adjusted ArcSine
aatan2
Adjusted atan2
adjlon
Adjust longitude to be in -180..+180 range (but in radians)
asqrt
Adjusted square root
authalic_lat
Computes authalic latitude from the geographic latitude. qp is q at phi=90deg, i.e. qp = pj_authalic_lat_q(1, e, one_es)
authalic_lat_compute_coeffs
Computes coefficients needed for conversions between geographic and authalic latitude. These are preferred over the analytical expressions for |n| < 0.01. However the inverse series is used to start the inverse method for large |n|. Ensure we use the cutoff in n consistently
authalic_lat_inverse
Compute the geographic latitude from beta = authalic_latitude where APA = pj_compute_coefficients_for_inverse_authalic_lat() and qp = pj_authalic_lat_q(1, proj.e, proj.one_es)
authalic_lat_q
Computes coefficient q such that authalic_latitude = beta = asin(q / qp) where qp is q at phi=90deg, i.e. qp = authalic_lat_q(1, e, one_es) Cf Snyder (3-11) and (3-12)
authalic_series_valid
Ensure we use the cutoff in n consistently
auxlat_coeffs
The following routines auxlat_coeffs, polyvol, clenshaw, auxlat_convert (3 signatures) provide a uniform interface for converting between any pair of auxiliary latitudes using series expansions in the third flattening, n. There are 6 (= AuxLat::NUMBER) auxiliary latitudes supported labeled by
auxlat_convert
Convert auxiliary latitude zeta to eta, given coefficients F produced by pj_auxlats_coeffs(n, zeta, eta, F). K is the size of F (defaults to AuxLat::ORDER).
auxlat_convert_full
Convert auxiliary latitude zeta to eta, given coefficients F produced by pj_auxlats_coeffs(n, zeta, eta, F). K is the size of F (defaults to AuxLat::ORDER). In this signature, the sine and cosine of eta are returned. This provides high relative accuracy near the poles.
auxlat_convert_mid
Convert auxiliary latitude zeta to eta, given coefficients F produced by pj_auxlats_coeffs(n, zeta, eta, F). In this signature, szeta and czeta (the sine and cosine of zeta) are given as inputs. K is the size of F (defaults to AuxLat::ORDER).
clenshaw
Evaluate y = sum(F[k] * sin((2*k+2) * zeta), k, 0, K-1) by Clenshaw summation. zeta is specify by its sine and cosine, szeta and czeta.
enfn
meridional distance for ellipsoid and inverse using 6th-order expansion in the third flattening n. This gives full double precision accuracy for |f| <= 1/150.
generic_inverse_2d
Compute (lam, phi) corresponding to input (xy.x, xy.y) for projection P.
inv_mlfn
inverse meridional distance
mlfn
meridional distance for ellipsoid and inverse using 6th-order expansion in the third flattening n.
msfn
Compute the meridian scale factor
phi2
Determine latitude angle phi-2. Inputs: ts = exp(-psi) where psi is the isometric latitude (dimensionless) this variable is defined in Snyder (1987), Eq. (7-10) e = eccentricity of the ellipsoid (dimensionless) Output: phi = geographic latitude (radians) Here isometric latitude is defined by psi = log( tan(pi/4 + phi/2) * ( (1 - esin(phi)) / (1 + esin(phi)) )^(e/2) ) = asinh(tan(phi)) - e * atanh(e * sin(phi)) = asinh(tan(chi)) chi = conformal latitude
polyval
Evaluation sum(p[i] * x^i, i, 0, N) via Horner’s method. N.B. p is of length N+1.
rectifying_radius
Compute the rectifying radius = quarter meridian / (pi/2 * a). The accuracy of this series is the same as those used for the computation of the auxiliary latitudes.
sinhpsi2tanphi
Convert tau’ = sinh(psi) = tan(chi) to tau = tan(phi). The code is taken from GeographicLib::Math::tauf(taup, e).
tsfn
Determine function ts(phi) defined in Snyder (1987), Eq. (7-10) Inputs: phi = geographic latitude (radians) e = eccentricity of the ellipsoid (dimensionless) Output: ts = exp(-psi) where psi is the isometric latitude (dimensionless) = 1 / (tan(chi) + sec(chi)) Here isometric latitude is defined by psi = log( tan(pi/4 + phi/2) * ( (1 - esin(phi)) / (1 + esin(phi)) )^(e/2) ) = asinh(tan(phi)) - e * atanh(e * sin(phi)) = asinh(tan(chi)) chi = conformal latitude
zpoly1
note: coefficients are always from C_1 to C_n i.e. C_0 == (0., 0) n should always be >= 1 though no checks are made
zpolyd1
evaluate complex polynomial and derivative