import std.stdio, std.conv, std.string, std.bigint; import std.math, std.random, std.datetime; import std.array, std.range, std.algorithm, std.container, std.format; string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; } void main(){ real xa = read.to!real; real ya = read.to!real; real tha = read.to!real; real x11 = read.to!real; real y11 = read.to!real; real x12 = read.to!real + 0.00001; real y12 = read.to!real + 0.00001; // ぴったり重なるのを防止 real x21 = read.to!real; real y21 = read.to!real; real x22 = read.to!real; real y22 = read.to!real; // AがA'にうつるように平行移動すると、Bは… debug writeln("p = (", x21 - x11, ", ", y21 - y11, ")"); real b1x = x12 + (x21 - x11); real b1y = y12 + (y21 - y11); debug writeln("B1(", b1x, ", ", b1y, ")"); // これがB'にうつるように回転する回転角 real ux = b1x - x21; real uy = b1y - y21; debug writeln("u = (", ux, ", ", uy, ")"); real vx = x22 - x21; real vy = y22 - y21; debug writeln("v = (", vx, ", ", vy, ")"); real c = (ux * vx + uy * vy) / sqrt(ux * ux + uy * uy) / sqrt(vx * vx + vy * vy); real s = (ux * vy - vx * uy) / sqrt(ux * ux + uy * uy) / sqrt(vx * vx + vy * vy); real th = (s >= 0? acos(c): 2.0 * PI - acos(c)) / 2.0 / PI * 360.0; debug writeln("th = ", th, " = (", c, ", ", s, ")"); // これらの逆変換を船に施す real oux = xa - x21; real ouy = ya - y21; debug writeln("u = (", oux, ", ", ouy, ")"); real ovx = c * oux + s * ouy; real ovy = -s * oux + c * ouy; debug writeln("v = (", ovx, ", ", ovy, ")"); real o1x = x21 + ovx; real o1y = y21 + ovy; debug writeln("O1(", o1x, ", ", o1y, ")"); real o2x = o1x - (x21 - x11); real o2y = o1y - (y21 - y11); debug writeln("O2(", o2x, ", ", o2y, ")"); real th2 = tha - th; th2 += 360.0 + 360.0; while(th2 >= 360.0) th2 -= 360.0; writeln(o2x.format!"%6.6f", " ", o2y.format!"%6.6f", " ", th2.format!"%6.6f"); }