PostGIS  2.2.7dev-r@@SVN_REVISION@@
void ll2cart ( const POINT2D g,
POINT3D p 
)

Convert lon/lat coordinates to cartesion coordinates on unit sphere.

Definition at line 373 of file lwgeodetic.c.

References POINT2D::x, POINT3D::x, POINT2D::y, POINT3D::y, and POINT3D::z.

Referenced by ptarray_calculate_gbox_geodetic(), and ptarray_contains_point_sphere().

374 {
375  double x_rad = M_PI * g->x / 180.0;
376  double y_rad = M_PI * g->y / 180.0;
377  double cos_y_rad = cos(y_rad);
378  p->x = cos_y_rad * cos(x_rad);
379  p->y = cos_y_rad * sin(x_rad);
380  p->z = sin(y_rad);
381 }
double y
Definition: liblwgeom.h:324
double x
Definition: liblwgeom.h:324
double z
Definition: liblwgeom.h:324
double x
Definition: liblwgeom.h:312
double y
Definition: liblwgeom.h:312

Here is the caller graph for this function: