PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ circumcenter()

static void circumcenter ( const POINT2D a,
const POINT2D b,
const POINT2D c,
POINT2D result 
)
static

Definition at line 103 of file lwboundingcircle.c.

References det(), POINT2D::x, and POINT2D::y.

Referenced by calculate_mbc_3().

104 {
105  double cx = c->x;
106  double cy = c->y;
107  double ax = a->x - cx;
108  double ay = a->y - cy;
109  double bx = b->x - cx;
110  double by = b->y - cy;
111 
112  double denom = 2 * det(ax, ay, bx, by);
113  double numx = det(ay, ax * ax + ay * ay, by, bx * bx + by * by);
114  double numy = det(ax, ax * ax + ay * ay, bx, bx * bx + by * by);
115 
116  result->x = cx - numx / denom;
117  result->y = cy + numy / denom;
118 }
double x
Definition: liblwgeom.h:328
double y
Definition: liblwgeom.h:328
static double det(double m00, double m01, double m10, double m11)
Here is the call graph for this function:
Here is the caller graph for this function: