PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ geog2cart()

void geog2cart ( const GEOGRAPHIC_POINT g,
POINT3D p 
)

Convert spherical coordinates to cartesion coordinates on unit sphere.

Definition at line 400 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(), circ_tree_contains_point(), circ_tree_distance_tree_internal(), circ_tree_get_point_outside(), CircTreePIP(), edge_calculate_gbox_slow(), edge_distance_to_point(), edge_point_in_cone(), edge_point_side(), line2pts(), lwpoly_covers_point2d(), lwpoly_pt_outside_hack(), ptarray_distance_spheroid(), ptarray_segmentize_sphere(), test_clairaut(), and test_edge_intersects().

401 {
402  p->x = cos(g->lat) * cos(g->lon);
403  p->y = cos(g->lat) * sin(g->lon);
404  p->z = sin(g->lat);
405 }
double y
Definition: liblwgeom.h:340
double x
Definition: liblwgeom.h:340
double z
Definition: liblwgeom.h:340
Here is the caller graph for this function: