PostGIS  2.1.10dev-r@@SVN_REVISION@@
double latitude_radians_normalize ( double  lat)

Convert a latitude to the range of -PI/2,PI/2.

Definition at line 55 of file lwgeodetic.c.

Referenced by geographic_point_init(), lwgeom_project_spheroid(), and point_deg2rad().

56 {
57 
58  if ( lat > 2.0 * M_PI )
59  lat = remainder(lat, 2.0 * M_PI);
60 
61  if ( lat < -2.0 * M_PI )
62  lat = remainder(lat, -2.0 * M_PI);
63 
64  if ( lat > M_PI )
65  lat = M_PI - lat;
66 
67  if ( lat < -1.0 * M_PI )
68  lat = -1.0 * M_PI - lat;
69 
70  if ( lat > M_PI_2 )
71  lat = M_PI - lat;
72 
73  if ( lat < -1.0 * M_PI_2 )
74  lat = -1.0 * M_PI - lat;
75 
76  return lat;
77 }

Here is the caller graph for this function: