PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ ll2cart()

void ll2cart ( const POINT2D g,
POINT3D p 
)

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

Definition at line 392 of file lwgeodetic.c.

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

Referenced by lwpoly_intersects_line(), ptarray_calculate_gbox_geodetic(), ptarray_contains_point_sphere(), and test_sphere_project().

393 {
394  double x_rad = M_PI * g->x / 180.0;
395  double y_rad = M_PI * g->y / 180.0;
396  double cos_y_rad = cos(y_rad);
397  p->x = cos_y_rad * cos(x_rad);
398  p->y = cos_y_rad * sin(x_rad);
399  p->z = sin(y_rad);
400 }
double y
Definition: liblwgeom.h:342
double x
Definition: liblwgeom.h:342
double z
Definition: liblwgeom.h:342
double x
Definition: liblwgeom.h:330
double y
Definition: liblwgeom.h:330
Here is the caller graph for this function: