#include #include #include using namespace std; typedef complex P; const double pi = acos(-1); P input() { double x, y; cin >> x >> y; return P(x, y); } int main() { P z = input(); double theta; cin >> theta; theta = theta / 360 * 2 * pi; P A = input(); P B = input(); P aa = input(); P bb = input(); P a = (aa - z) * polar(1.0, -theta); P b = (bb - z) * polar(1.0, -theta); P ephi = (A - B) / (a - b); P w = A - a * ephi; double phi = arg(ephi) / (2 * pi) * 360; if (phi < 0) phi += 360; printf("%.15f %.15f %.15f\n", real(w), imag(w), phi); }