PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ cart2geog()

void cart2geog ( const POINT3D p,
GEOGRAPHIC_POINT g 
)

Convert cartesion coordinates on unit sphere to spherical coordinates.

Definition at line 364 of file lwgeodetic.c.

References GEOGRAPHIC_POINT::lat, GEOGRAPHIC_POINT::lon, POINT3D::x, POINT3D::y, and POINT3D::z.

Referenced by circ_center_cartesian(), circ_node_leaf_new(), clairaut_cartesian(), clairaut_geographic(), edge_distance_to_point(), gbox_centroid(), gbox_pt_outside(), and ptarray_segmentize_sphere().

365 {
366  g->lon = atan2(p->y, p->x);
367  g->lat = asin(p->z);
368 }
double y
Definition: liblwgeom.h:324
double x
Definition: liblwgeom.h:324
double z
Definition: liblwgeom.h:324
Here is the caller graph for this function: