#! /usr/bin/gawk -f # Last edited on 2001-11-16 23:24:06 by stolfi BEGIN { px = ARGV[1] + 0; # X of center of rotation py = ARGV[2] + 0; # Y of center of rotation dt = ARGV[3] + 0; # Rotation angle in degrees dx = ARGV[4] + 0; # X displacement in pixels dy = ARGV[5] + 0; # Y displacement in pixels ARGC = 1; pi = 3.1415926; ct = cos(pi*dt/180.0); st = sin(pi*dt/180.0); } ($2 + 0 == -1) { x = $4 - px; y = $5 - py; c = $8; s = $9; xn = dx + x*ct - y*st + px; yn = dy + x*st + y*ct + py; cn = c*ct - s*st; sn = c*st + s*ct; printf "%03d %03d 1 %10.3f %10.3f 0 0 %8.5f %8.5f 0 0 %8.5f %8.5f 0 0 0 0 1\n", $1, $2, xn, yn, cn, sn, -sn, cn; next; }