src/Common.php
public static function phi2z($eccent, $ts)
    {
        $eccnth = 0.5 * $eccent;
        $phi = M_PI_2 - 2 * atan($ts);

        for ($i = 0; $i <= 15; $i++) {
            $con = $eccent * sin($phi);
            $dphi = M_PI_2
                - 2 * atan($ts * (pow(((1.0 - $con) / (1.0 + $con)), $eccnth )))
                - $phi;
            $phi += $dphi;

            if (abs($dphi) <= .0000000001) {
                return $phi;
            }
        }

        assert("false; /* phi2z has NoConvergence */");

        // What does this return value mean?
        return (-9999);
    }
public static function phi2z($eccent, $ts)
    {
        $eccnth = 0.5 * $eccent;
        $phi = M_PI_2 - 2 * atan($ts);

        for ($i = 0; $i <= 15; $i++) {
            $con = $eccent * sin($phi);
            $dphi = M_PI_2
                - 2 * atan($ts * (pow(((1.0 - $con) / (1.0 + $con)), $eccnth )))
                - $phi;
            $phi += $dphi;

            if (abs($dphi) <= .0000000001) {
                return $phi;
            }
        }

        assert("false; /* phi2z has NoConvergence */");

        // What does this return value mean?
        return (-9999);
    }
public static function phi2z ( $ eccent , $ ts ) { $ eccnth = 0.5 * $ eccent ; $ phi = M_PI_2 - 2 * atan ( $ ts ) ; for ( $ i = 0 ; $ i <= 15 ; $ i ++ ) { $ con = $ eccent * sin ( $ phi ) ; $ dphi = M_PI_2 - 2 * atan ( $ ts * ( pow ( ( ( 1.0 - $ con ) / ( 1.0 + $ con ) ) , $ eccnth ) ) ) - $ phi ; $ phi += $ dphi ; if ( abs ( $ dphi ) <= .0000000001 ) { return $ phi ; } } assert ( "false; /* phi2z has NoConvergence */" ) ; // What does this return value mean? return ( - 9999 ) ; }
Function to compute the latitude angle, phi2, for the inverse of the
Lambert Conformal Conic and Polar Stereographic projections.

rise up an assertion if there is no convergence.

@param float $eccent
@param float $ts
@return float|int
Function to compute the latitude angle phi2 for the inverse of the Lambert Conformal Conic and Polar Stereographic projections .