PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ calculate_mbc_2()

static void calculate_mbc_2 ( const SUPPORTING_POINTS support,
LWBOUNDINGCIRCLE mbc 
)
static

Definition at line 129 of file lwboundingcircle.c.

References LWBOUNDINGCIRCLE::center, distance2d_pt_pt(), FP_MAX, SUPPORTING_POINTS::p1, SUPPORTING_POINTS::p2, LWBOUNDINGCIRCLE::radius, POINT2D::x, and POINT2D::y.

Referenced by calculate_mbc_from_support().

130 {
131  double d1, d2;
132 
133  mbc->center->x = 0.5*(support->p1->x + support->p2->x);
134  mbc->center->y = 0.5*(support->p1->y + support->p2->y);
135 
136  d1 = distance2d_pt_pt(mbc->center, support->p1);
137  d2 = distance2d_pt_pt(mbc->center, support->p2);
138 
139  mbc->radius = FP_MAX(d1, d2);
140 }
double distance2d_pt_pt(const POINT2D *p1, const POINT2D *p2)
The old function nessecary for ptarray_segmentize2d in ptarray.c.
Definition: measures.c:2317
const POINT2D * p1
double x
Definition: liblwgeom.h:328
double y
Definition: liblwgeom.h:328
POINT2D * center
Definition: liblwgeom.h:1643
const POINT2D * p2
#define FP_MAX(A, B)
Here is the call graph for this function:
Here is the caller graph for this function: