PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ test_lw_arc_center()

static void test_lw_arc_center ( void  )
static

Definition at line 93 of file cu_algorithm.c.

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

Referenced by algorithms_suite_setup().

94 {
95 /* double lw_arc_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D *result); */
96  POINT2D c1;
97  double d1;
98  POINT2D p1, p2, p3;
99 
100  p1.x = 2047538.600;
101  p1.y = 7268770.435;
102  p2.x = 2047538.598;
103  p2.y = 7268770.435;
104  p3.x = 2047538.596;
105  p3.y = 7268770.436;
106 
107  d1 = lw_arc_center(&p1, &p2, &p3, &c1);
108 
109  CU_ASSERT_DOUBLE_EQUAL(d1, 0.0046097720751, 0.0001);
110  CU_ASSERT_DOUBLE_EQUAL(c1.x, 2047538.599, 0.001);
111  CU_ASSERT_DOUBLE_EQUAL(c1.y, 7268770.4395, 0.001);
112 
113  // printf("lw_arc_center: (%12.12g, %12.12g) %12.12g\n", c1.x, c1.y, d1);
114 }
double lw_arc_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D *result)
Determines the center of the circle defined by the three given points.
Definition: lwalgorithm.c:227
double x
Definition: liblwgeom.h:328
double y
Definition: liblwgeom.h:328
Here is the call graph for this function:
Here is the caller graph for this function: