PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ lwpoint_inside_circle()

int lwpoint_inside_circle ( const LWPOINT p,
double  cx,
double  cy,
double  rad 
)

Definition at line 662 of file lwgeom.c.

663 {
664  const POINT2D *pt;
665  POINT2D center;
666 
667  if ( ! p || ! p->point )
668  return LW_FALSE;
669 
670  pt = getPoint2d_cp(p->point, 0);
671 
672  center.x = cx;
673  center.y = cy;
674 
675  if ( distance2d_pt_pt(pt, &center) < rad )
676  return LW_TRUE;
677 
678  return LW_FALSE;
679 }
#define LW_FALSE
Definition: liblwgeom.h:94
double distance2d_pt_pt(const POINT2D *p1, const POINT2D *p2)
Definition: measures.c:2398
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:93
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
Definition: lwinline.h:101
POINTARRAY * point
Definition: liblwgeom.h:471
double y
Definition: liblwgeom.h:390
double x
Definition: liblwgeom.h:390

References distance2d_pt_pt(), getPoint2d_cp(), LW_FALSE, LW_TRUE, LWPOINT::point, POINT2D::x, and POINT2D::y.

Referenced by LWGEOM_inside_circle_point().

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