tethys-feature-service/node_modules/proj4/lib/common/latiso.js
2023-10-02 15:04:02 +02:00

17 lines
419 B
JavaScript

import {HALF_PI} from '../constants/values';
export default function(eccent, phi, sinphi) {
if (Math.abs(phi) > HALF_PI) {
return Number.NaN;
}
if (phi === HALF_PI) {
return Number.POSITIVE_INFINITY;
}
if (phi === -1 * HALF_PI) {
return Number.NEGATIVE_INFINITY;
}
var con = eccent * sinphi;
return Math.log(Math.tan((HALF_PI + phi) / 2)) + eccent * Math.log((1 - con) / (1 + con)) / 2;
}