src/mod_retile.cpp
static double lat2wm(double eres, double lat) {
    if (abs(lat) > 85.052)
        return (lat > 0) ? (0.5 / eres) : (-0.5 / eres); // pi*R or -pi*R
    return log(tan(pi / 4 * (1 + lat / 90))) / eres / 2 / pi;
}
// Goes out of bounds close to the poles, valid latitude range is under 85.052
Goes out of bounds close to the poles, valid latitude range is under 85.052
Goes out of bounds close to the poles valid latitude range is under 85 . 052
static double lat2wm(double eres, double lat) {
    if (abs(lat) > 85.052)
        return (lat > 0) ? (0.5 / eres) : (-0.5 / eres); 
    return log(tan(pi / 4 * (1 + lat / 90))) / eres / 2 / pi;
}
static double lat2wm ( double eres , double lat ) { if ( abs ( lat ) > 85.052 ) return ( lat > 0 ) ? ( 0.5 / eres ) : ( -0.5 / eres ) ; return log ( tan ( pi / 4 * ( 1 + lat / 90 ) ) ) / eres / 2 / pi ; }
Goes out of bounds close to the poles, valid latitude range is under 85.052
Goes out of bounds close to the poles valid latitude range is under 85 . 052
// pi*R or -pi*R