PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ circ_tree_get_point_outside()

int circ_tree_get_point_outside ( const CIRC_NODE node,
POINT2D pt 
)

Definition at line 474 of file lwgeodetic_tree.c.

475{
476 POINT3D center3d;
478 // if (node->radius >= M_PI) return LW_FAILURE;
479 geog2cart(&(node->center), &center3d);
480 vector_scale(&center3d, -1.0);
481 cart2geog(&center3d, &g);
482 pt->x = rad2deg(g.lon);
483 pt->y = rad2deg(g.lat);
484 return LW_SUCCESS;
485}
#define LW_SUCCESS
Definition liblwgeom.h:97
void vector_scale(POINT3D *n, double scale)
Scale a vector out by a factor.
Definition lwgeodetic.c:487
void cart2geog(const POINT3D *p, GEOGRAPHIC_POINT *g)
Convert cartesian coordinates on unit sphere to spherical coordinates.
Definition lwgeodetic.c:414
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesian coordinates on unit sphere.
Definition lwgeodetic.c:404
#define rad2deg(r)
Definition lwgeodetic.h:81
Point in spherical coordinates on the world.
Definition lwgeodetic.h:54
double y
Definition liblwgeom.h:390
double x
Definition liblwgeom.h:390
GEOGRAPHIC_POINT center

References cart2geog(), circ_node::center, geog2cart(), GEOGRAPHIC_POINT::lat, GEOGRAPHIC_POINT::lon, LW_SUCCESS, rad2deg, vector_scale(), POINT2D::x, and POINT2D::y.

Referenced by CircTreePIP().

Here is the call graph for this function:
Here is the caller graph for this function: