PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ geog2cart()

void geog2cart ( const GEOGRAPHIC_POINT g,
POINT3D p 
)

Convert spherical coordinates to cartesian coordinates on unit sphere.

Definition at line 404 of file lwgeodetic.c.

405 {
406  p->x = cos(g->lat) * cos(g->lon);
407  p->y = cos(g->lat) * sin(g->lon);
408  p->z = sin(g->lat);
409 }
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_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().

Here is the caller graph for this function: