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

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

Definition at line 374 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().

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

Here is the caller graph for this function: