// yukicoder: No.760 Where am I moved to? // bal4u 2019.8.18 #include #include #include #if 0 int getchar_unlocked(); #define gc() getchar_unlocked() #else #define gc() getchar() #endif #if 1 double getdbl() { double a; scanf("%lf", &a); return a; } #else double getdbl() { // 実数の入力 int minus = 0; double x, y; int n = 0, c = gc(); while (isspace(c)) c = gc(); if (c == '-') minus = 1, c = gc(); do n = 10*n + (c & 0xf), c = gc(); while (c >= '0'); if (c == '.') { x = 0; y = 1, c = gc(); do y *= 0.1, x += y * (c & 0xf), c = gc(); while (c >= '0'); x += n; } else x = n; if (minus) x = -x; return x; } #endif #define PI 3.1415926535897932384626433832795 #define EPS 1e-13 typedef struct { double x, y; } PP; PP vadd(PP p1, PP p2) { PP r; r.x = p1.x + p2.x, r.y = p1.y + p2.y; return r; } PP vsub(PP p1, PP p2) { PP r; r.x = p1.x - p2.x, r.y = p1.y - p2.y; return r; } PP vsmul(PP p, double k) { PP r; r.x = p.x * k, r.y = p.y * k; return r; } double dist(PP p1, PP p2) { return hypot(p1.x-p2.x, p1.y-p2.y); } double cross(PP a, PP b) { return a.x * b.y - a.y * b.x; } double dot(PP a, PP b) { return a.x * b.x + a.y * b.y; } double norm(PP a) { return a.x * a.x + a.y * a.y; } PP rot(PP a, double delta) { PP r; r.x = a.x*cos(delta) - a.y*sin(delta); r.y = a.x*sin(delta) + a.y*cos(delta); return r; } int main() { double da, db, d; PP pa, pb, p11, p12, p21, p22, p1, p2; pa.x = getdbl(), pa.y = getdbl(), da = getdbl()/180*PI; p11.x = getdbl(), p11.y = getdbl(); p12.x = getdbl(), p12.y = getdbl(); p21.x = getdbl(), p21.y = getdbl(); p22.x = getdbl(), p22.y = getdbl(); p1 = vsub(p12, p11), p2 = vsub(p22, p21); d = atan2(p1.y, p1.x) - atan2(p2.y, p2.x); db = da + d; pb = vsub(p11, rot(vsub(p21, pa), d)); printf("%.12lf %.12lf %.12lf\n", pb.x+EPS, pb.y+EPS, db/PI*180+EPS); return 0; }