#include<iostream>
#include<math.h>
const int N = 1000;
using namespace std;
struct op {
int k;
double l;
};
struct point {
int i;
int j;
double x;
double y;
};
int main() {
int m, n;
cin >> n >> m;
op op[N] = { 0 };
point point[N] = { 0 };
for (int ii = 0; ii < n; ii++) {
cin >> op[ii].k >> op[ii].l;
}
for (int ii = 0; ii < m; ii++) {
cin >> point[ii].i >> point[ii].j >> point[ii].x >> point[ii].y;
for (int jj = point[ii].i - 1; jj < point[ii].j; jj++) {
if (op[jj].k == 1) {
point[ii].x = op[jj].l * point[ii].x;
point[ii].y = op[jj].l * point[ii].y;
}
else {
double xx = point[ii].x;
double yy = point[ii].y;
point[ii].x = xx * cos(op[jj].l) - yy * sin(op[jj].l);
point[ii].y = xx * sin(op[jj].l) + yy * cos(op[jj].l);
}
}
}
for (int ii = 0; ii < m; ii++) {
printf("%f %f\n", point[ii].x, point[ii].y);
}
return 0;
}
csp真题 2023-9 坐标变换(其二)80分常规解法
于 2023-12-07 23:12:07 首次发布