]> granicus.if.org Git - postgis/commitdiff
Rename lwcircle_center to lw_arc_center to match other lwalgorithm signatures
authorPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 1 Oct 2012 22:18:14 +0000 (22:18 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 1 Oct 2012 22:18:14 +0000 (22:18 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10357 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/g_box.c
liblwgeom/liblwgeom_internal.h
liblwgeom/lwalgorithm.c
liblwgeom/lwsegmentize.c
liblwgeom/measures.c

index 8c4d61ab3995d9911c2670a34704c7c77d31f03f..3c01c14b920175bb47d9583359e9ab61d94e04c0 100644 (file)
@@ -330,7 +330,7 @@ int lwcircle_calculate_gbox_cartesian_2d(const POINT2D *A1, const POINT2D *A2, c
 
        LWDEBUG(2, "lwcircle_calculate_gbox_cartesian_2d called.");
 
-       radius_A = lwcircle_center(A1, A2, A3, &C);
+       radius_A = lw_arc_center(A1, A2, A3, &C);
 
        /* Negative radius signals straight line, p1/p2/p3 are colinear */
        if (radius_A < 0.0)
index 6203ad37cffcc942cf6ca22ca0b176cc77ef08c8..25878aa3aa3020ac2c208e2dc94700143c254a70 100644 (file)
@@ -353,7 +353,7 @@ int lwtin_is_closed(const LWTIN *tin);
 */
 int lw_segment_side(const POINT2D *p1, const POINT2D *p2, const POINT2D *q);
 int lwcircle_calculate_gbox_cartesian_2d(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3, GBOX *gbox);
-double lwcircle_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D *result);
+double lw_arc_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D *result);
 int lw_pt_in_seg(const POINT2D *P, const POINT2D *A1, const POINT2D *A2);
 int lw_pt_in_arc(const POINT2D *P, const POINT2D *A1, const POINT2D *A2, const POINT2D *A3);
 int lw_arc_is_pt(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3);
index 531d282b711ba8f17a0000f48c25313000a39e31..dd7307a756a2b3d2be6494558017733ba3df3aa0 100644 (file)
@@ -99,7 +99,7 @@ lw_arc_length(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3)
        if ( lw_arc_is_pt(A1, A2, A3) )
                return 0.0;
        
-       radius_A = lwcircle_center(A1, A2, A3, &C);
+       radius_A = lw_arc_center(A1, A2, A3, &C);
 
        /* Co-linear! Return linear distance! */
        if ( radius_A < 0 ) 
@@ -155,7 +155,7 @@ double lw_arc_side(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3, cons
        double d;
        
        side_Q = lw_segment_side(A1, A3, Q);
-       radius_A = lwcircle_center(A1, A2, A3, &C);
+       radius_A = lw_arc_center(A1, A2, A3, &C);
        side_A2 = lw_segment_side(A1, A3, A2);
        
        /* Linear case */
@@ -180,7 +180,7 @@ double lw_arc_side(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3, cons
 * point is coincident with either end point, they are taken as colinear.
 */
 double
-lwcircle_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D *result)
+lw_arc_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D *result)
 {
        POINT2D c;
        double cx, cy, cr;
@@ -188,7 +188,7 @@ lwcircle_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D
 
     c.x = c.y = 0.0;
 
-       LWDEBUGF(2, "lwcircle_center called (%.16f,%.16f), (%.16f,%.16f), (%.16f,%.16f).", p1->x, p1->y, p2->x, p2->y, p3->x, p3->y);
+       LWDEBUGF(2, "lw_arc_center called (%.16f,%.16f), (%.16f,%.16f), (%.16f,%.16f).", p1->x, p1->y, p2->x, p2->y, p3->x, p3->y);
 
        /* Closed circle */
        if (fabs(p1->x - p3->x) < EPSILON_SQLMM &&
@@ -221,7 +221,7 @@ lwcircle_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D
        *result = c;
        cr = sqrt((cx-p1->x)*(cx-p1->x)+(cy-p1->y)*(cy-p1->y));
        
-       LWDEBUGF(2, "lwcircle_center center is (%.16f,%.16f)", result->x, result->y);
+       LWDEBUGF(2, "lw_arc_center center is (%.16f,%.16f)", result->x, result->y);
        
        return cr;
 }
index aa1c008eec36710fc376a1ba9e990d9ee385b90e..28606377df8f008d5ab1623690bbc3dc57c2c3d8 100644 (file)
@@ -100,6 +100,9 @@ static POINTARRAY *
 lwcircle_segmentize(POINT4D *p1, POINT4D *p2, POINT4D *p3, uint32_t perQuad)
 {
        POINT2D center;
+       POINT2D *t1 = (POINT2D*)p1;
+       POINT2D *t2 = (POINT2D*)p2;
+       POINT2D *t3 = (POINT2D*)p3;
        POINT4D pt;
        int p2_side = 0;
        int clockwise = LW_TRUE;
@@ -112,8 +115,8 @@ lwcircle_segmentize(POINT4D *p1, POINT4D *p2, POINT4D *p3, uint32_t perQuad)
 
        LWDEBUG(2, "lwcircle_calculate_gbox called.");
 
-       radius = lwcircle_center((POINT2D*)p1, (POINT2D*)p2, (POINT2D*)p3, &center);
-       p2_side = lw_segment_side((POINT2D*)p1, (POINT2D*)p3, (POINT2D*)p2);
+       radius = lw_arc_center(t1, t2, t3, &center);
+       p2_side = lw_segment_side(t1, t3, t2);
 
        /* Matched start/end points imply circle */
        if ( p1->x == p3->x && p1->y == p3->y )
@@ -474,7 +477,7 @@ static int pt_continues_arc(const POINT4D *a1, const POINT4D *a2, const POINT4D
        POINT2D *t2 = (POINT2D*)a2;
        POINT2D *t3 = (POINT2D*)a3;
        POINT2D *tb = (POINT2D*)b;
-       double radius = lwcircle_center(t1, t2, t3, &center);
+       double radius = lw_arc_center(t1, t2, t3, &center);
        double b_distance, diff;
 
        /* Co-linear a1/a2/a3 */
index 053abef08382ea56bc4718712099d9614e8a31d6..dbee74e90f981fcb6a2762b0d53ead553185b737 100644 (file)
@@ -848,7 +848,7 @@ lw_dist2d_seg_arc(const POINT2D *A1, const POINT2D *A2, const POINT2D *B1, const
                return lw_dist2d_pt_seg(B1, A1, A2, dl);
 
        /* Calculate center and radius of the circle. */
-       radius_C = lwcircle_center(B1, B2, B3, &C);
+       radius_C = lw_arc_center(B1, B2, B3, &C);
 
        /* This "arc" is actually a line (B2 is colinear with B1,B3) */
        if ( radius_C < 0.0 )
@@ -991,7 +991,7 @@ lw_dist2d_pt_arc(const POINT2D* P, const POINT2D* A1, const POINT2D* A2, const P
                return lw_dist2d_pt_pt(P, A1, dl);
 
        /* Calculate centers and radii of circles. */
-       radius_A = lwcircle_center(A1, A2, A3, &C);
+       radius_A = lw_arc_center(A1, A2, A3, &C);
        
        /* This "arc" is actually a line (A2 is colinear with A1,A3) */
        if ( radius_A < 0.0 )
@@ -1044,8 +1044,8 @@ lw_dist2d_arc_arc(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3,
                return lw_dist2d_pt_arc(A1, B1, B2, B3, dl);
        
        /* Calculate centers and radii of circles. */
-       radius_A = lwcircle_center(A1, A2, A3, &CA);
-       radius_B = lwcircle_center(B1, B2, B3, &CB);
+       radius_A = lw_arc_center(A1, A2, A3, &CA);
+       radius_B = lw_arc_center(B1, B2, B3, &CB);
 
        /* Two co-linear arcs?!? That's two segments. */
        if ( radius_A < 0 && radius_B < 0 )