Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- const long double pi = 3.1415926535897932384626433832795;
- const long double EPS = 1e-7;
- long double px, py, qx, qy;
- long double ux, uy;
- long double v;
- int n;
- int main()
- {
- ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
- //freopen("","r",stdin);
- //freopen("","w",stdout);
- cin >> px >> py >> qx >> qy >> ux >> uy >> v >> n;
- long double x, y;
- x = qx-px;
- y = qy-py;
- long double r = sqrt(x*x + y*y);
- for(int i = 0; i < n; i++){
- long double t;
- cin >> t;
- long double cycles = t*v/2/pi/r;
- cycles -= (int)cycles;
- long double degree = cycles*2*pi;
- long double cosd = cos(degree);
- long double sind = sin(degree);
- long double endx, endy;
- endx = (x*cosd - y*sind) + px;
- endy = (x*sind + y*cosd) + py;
- endx += ux*t;
- endy += uy*t;
- cout << endx << " " << endy << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement