PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ cart2geog()

void cart2geog ( const POINT3D p,
GEOGRAPHIC_POINT g 
)

Convert cartesian coordinates on unit sphere to spherical coordinates.

Definition at line 414 of file lwgeodetic.c.

415 {
416  g->lon = atan2(p->y, p->x);
417  g->lat = asin(p->z);
418 }
double z
Definition: liblwgeom.h:343
double x
Definition: liblwgeom.h:343
double y
Definition: liblwgeom.h:343

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

Referenced by circ_center_cartesian(), circ_node_leaf_new(), circ_tree_get_point_outside(), clairaut_cartesian(), clairaut_geographic(), edge_distance_to_point(), gbox_centroid(), gbox_get_sortable_hash(), gbox_pt_outside(), lwpoly_pt_outside_hack(), and ptarray_segmentize_sphere_edge_recursive().

Here is the caller graph for this function: