]> granicus.if.org Git - graphviz/commitdiff
consolidate PI into M_PI
authorellson <devnull@localhost>
Mon, 3 Mar 2008 23:01:52 +0000 (23:01 +0000)
committerellson <devnull@localhost>
Mon, 3 Mar 2008 23:01:52 +0000 (23:01 +0000)
lib/fdpgen/layout.c
lib/neatogen/neatoinit.c
lib/neatogen/neatosplines.c
lib/neatogen/poly.c

index 5696a3a9035bf99380bbe8da8b81f0673bdd5c1c..04f32122093742d43f884d3eabcec8b44adc5396 100644 (file)
@@ -598,7 +598,7 @@ static int ecmp(const void *v1, const void *v2)
        return 0;
 }
 
-#define ANG (PI/90)            /* Maximum angular change: 2 degrees */
+#define ANG (M_PI/90)          /* Maximum angular change: 2 degrees */
 
 /* getEdgeList:
  * Generate list of edges in derived graph g using
@@ -647,7 +647,7 @@ static erec *getEdgeList(node_t * n, graph_t * g)
                i = j;
            else {
                if (j == deg)
-                   bnd = PI;   /* all values equal up to end */
+                   bnd = M_PI; /* all values equal up to end */
                else
                    bnd = erecs[j].alpha;
                delta = (bnd - a) / (j - i);
@@ -749,7 +749,7 @@ static graph_t *expandCluster(node_t * n, graph_t * cg)
            if (next->e)
                bnd = next->alpha;
            else
-               bnd = 2 * PI + es->alpha;
+               bnd = 2 * M_PI + es->alpha;
            idx = genPorts(n, ep, pp, idx, bnd);
            ep = next;
        }
index dd49d6dba2cd0c1fea3cda48b658688d4e2c462b..93b5685e67d1869084d3761090119e240c8a1711 100644 (file)
@@ -1003,7 +1003,7 @@ static void initRegular(graph_t * G, int nG)
     node_t *np;
 
     a = 0.0;
-    da = (2 * PI) / nG;
+    da = (2 * M_PI) / nG;
     for (np = agfstnode(G); np; np = agnxtnode(G, np)) {
        ND_pos(np)[0] = nG * Spring_coeff * cos(a);
        ND_pos(np)[1] = nG * Spring_coeff * sin(a);
index 057b05d97e91cbd25cb3fcc8696e4e89a6267d97..0134b3ce5ede17081cdb72db477077d0effada2c 100644 (file)
@@ -505,8 +505,8 @@ Ppoly_t *makeObstacle(node_t * n, double SEP)
                polyp.y = poly->vertices[j].y * SEP;
            } else {
                double c, s;
-               c = cos(2.0 * PI * j / sides + adj);
-               s = sin(2.0 * PI * j / sides + adj);
+               c = cos(2.0 * M_PI * j / sides + adj);
+               s = sin(2.0 * M_PI * j / sides + adj);
                polyp.x = SEP * c * (ND_lw_i(n) + ND_rw_i(n)) / 2.0;
                polyp.y = SEP * s * ND_ht_i(n) / 2.0;
            }
index 6620987ee152268643b0ccc16df4554aac4fc5f0..1d05961ab0a1411ffd9348891cf5c8173abae03d 100644 (file)
@@ -81,7 +81,7 @@ static void inflate(Point * prev, Point * cur, Point * next, double margin)
     double theta = atan2(prev->y - cur->y, prev->x - cur->x);
     double phi = atan2(next->y - cur->y, next->x - cur->x);
     double beta = (theta + phi) / 2.0;
-    double gamma = (PI + phi - theta) / 2.0;
+    double gamma = (M_PI + phi - theta) / 2.0;
     double denom;
 
     denom = cos(gamma);
@@ -165,9 +165,9 @@ static Point *genRound(Agnode_t * n, int *sidep)
     verts = N_GNEW(sides, Point);
     for (i = 0; i < sides; i++) {
        verts[i].x =
-           ND_width(n) / 2.0 * cos(i / (double) sides * PI * 2.0);
+           ND_width(n) / 2.0 * cos(i / (double) sides * M_PI * 2.0);
        verts[i].y =
-           ND_height(n) / 2.0 * sin(i / (double) sides * PI * 2.0);
+           ND_height(n) / 2.0 * sin(i / (double) sides * M_PI * 2.0);
     }
     *sidep = sides;
     return verts;