Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #define pi acos(-1)
- int main()
- {
- int t, i;
- double x, y, theta, x1, y1;
- scanf("%d", &t);
- for(i = 1; i <= t; i++){
- scanf("%lf %lf %lf", &x, &y, &theta);
- theta = pi*theta/180;
- x1 = x*cos(theta)-y*sin(theta);
- y1 = x*sin(theta)+y*cos(theta);
- if(fabs(x1 - -0.000) < 1e-6)x1 = 0;
- if(fabs(y1 - -0.000) < 1e-6)y1 = 0;
- printf("Case %d: %.3lf %.3lf\n", i, x1, y1);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement