From: ellson Date: Mon, 3 Mar 2008 23:01:52 +0000 (+0000) Subject: consolidate PI into M_PI X-Git-Tag: LAST_LIBGRAPH~32^2~4594 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5656dd49d2a5b94ad5b4966bc4232d0d63d100e6;p=graphviz consolidate PI into M_PI --- diff --git a/lib/fdpgen/layout.c b/lib/fdpgen/layout.c index 5696a3a90..04f321220 100644 --- a/lib/fdpgen/layout.c +++ b/lib/fdpgen/layout.c @@ -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; } diff --git a/lib/neatogen/neatoinit.c b/lib/neatogen/neatoinit.c index dd49d6dba..93b5685e6 100644 --- a/lib/neatogen/neatoinit.c +++ b/lib/neatogen/neatoinit.c @@ -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); diff --git a/lib/neatogen/neatosplines.c b/lib/neatogen/neatosplines.c index 057b05d97..0134b3ce5 100644 --- a/lib/neatogen/neatosplines.c +++ b/lib/neatogen/neatosplines.c @@ -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; } diff --git a/lib/neatogen/poly.c b/lib/neatogen/poly.c index 6620987ee..1d05961ab 100644 --- a/lib/neatogen/poly.c +++ b/lib/neatogen/poly.c @@ -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;