PostGIS  2.1.10dev-r@@SVN_REVISION@@
double z_to_latitude ( double  z,
int  top 
)

Used in great circle to compute the pole of the great circle.

Definition at line 996 of file lwgeodetic.c.

References FP_IS_ZERO, LWDEBUGF, and signum.

Referenced by clairaut_cartesian(), and clairaut_geographic().

997 {
998  double sign = signum(z);
999  double tlat = acos(z);
1000  LWDEBUGF(4, "inputs: z(%.8g) sign(%.8g) tlat(%.8g)", z, sign, tlat);
1001  if (FP_IS_ZERO(z))
1002  {
1003  if (top) return M_PI_2;
1004  else return -1.0 * M_PI_2;
1005  }
1006  if (fabs(tlat) > M_PI_2 )
1007  {
1008  tlat = sign * (M_PI - fabs(tlat));
1009  }
1010  else
1011  {
1012  tlat = sign * tlat;
1013  }
1014  LWDEBUGF(4, "output: tlat(%.8g)", tlat);
1015  return tlat;
1016 }
#define signum(a)
Ape a java function.
Definition: lwgeodetic.h:66
#define FP_IS_ZERO(A)
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55

Here is the caller graph for this function: