<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import {HALF_PI} from '../constants/values';

export default function(eccent, phi, sinphi) {
  if (Math.abs(phi) &gt; 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;
}
</pre></body></html>