PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ geog2cart()

void geog2cart ( const GEOGRAPHIC_POINT g,
POINT3D p 
)

Convert spherical coordinates to cartesian coordinates on unit sphere.

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

374 {
375  p->x = cos(g->lat) * cos(g->lon);
376  p->y = cos(g->lat) * sin(g->lon);
377  p->z = sin(g->lat);
378 }
double y
Definition: liblwgeom.h:342
double x
Definition: liblwgeom.h:342
double z
Definition: liblwgeom.h:342
Here is the caller graph for this function: