#include #include #include using namespace std; int main() { double rat = acos(-1.0) / 180; double xx,xy,d; double ax,ay,bx,by; double Ax,Ay,Bx,By; scanf ("%lf %lf %lf",&xx,&xy,&d); scanf ("%lf %lf %lf %lf",&ax,&ay,&bx,&by); scanf ("%lf %lf %lf %lf",&Ax,&Ay,&Bx,&By); complex X(xx,xy),R=polar(1.,rat*d),a(ax,ay),b(bx,by),A(Ax,Ay),B(Bx,By); auto x = (a * (B - X) + (X - A) * b) / (B - A); auto r = (a - x) / (A - X) * R; printf ("%lf %lf %lf\n",x.real(),x.imag(),arg(r)/rat); return 0; }