#include <stdio.h>
#include<iostream>
#include<math.h>
#include<iomanip>
using namespace std;
double xs(int L, int W, int x, int y, int R, int a, int v, int s)
{
double m,a2;
a2 = a*asin(1) * 2 / 180;
m = x + v*s*cos(a2);
while (1)
{
if (m > L - R)
m = 2 * (L - R) - m;
else if (m < R)
m = 2 * R - m;
else break;
}
return m;
}
double ys(int L, int W, int x, int y, int R, int a, int v, int s)
{
double n, a2;
a2 = a*asin(1) * 2 / 180;
n = y + v*s*sin(a2);
while (1)
{
if (n > W - R)
n = 2 * (W - R) - n;
else if (n < R)
n = 2 * R - n;
else break;
}
return n;
}
int main()
{
int i=0, j,L, W, x, y, R, a, v, s;
double m[25],n[25],X,Y;
while (cin >> L >> W >> x >> y>> R >> a >> v >> s)
{
if (L == 0 && W == 0 && x== 0 && y == 0 && R == 0 && a == 0 && v == 0 && s == 0)
break;
m[i] = xs(L, W, x, y, R, a, v, s);
n[i] = ys(L, W, x, y, R, a, v, s);
i++;
}
for (j = 0; j < i; j++)
{
X = m[j];
Y = n[j];
cout <<setprecision(2)<<fixed<< X << " " <<setprecision(2)<<fixed<< Y << endl;
}
return 0;
}
0.0分
1 人评分
回文串 (C语言代码)浏览:3095 |
C语言程序设计教程(第三版)课后习题8.3 (C语言代码)浏览:790 |
C二级辅导-阶乘数列 (C语言代码)浏览:736 |
C语言程序设计教程(第三版)课后习题6.3 (C++代码)浏览:1067 |
printf基础练习2 (C语言代码)浏览:653 |
1118(求助_已解决)浏览:351 |
程序员的表白 (C语言代码)浏览:678 |
陶陶摘苹果2 (C语言代码)浏览:650 |
敲七 (C++代码)浏览:1119 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:801 |