1.真题来源
2.重点
坐标变换方式的统计。拉伸是多个操作相乘,旋转是多个操作相加。
3.运行结果
![在这里插入图片描述](https://img-blog.csdnimg.cn/dire
t/611ac7bb55e34396b1dd00935085a971.png)
PS:还是有运行超时的问题。欢迎广大网友提供建议~
4.Python运行代码
from math import cos, sin
n, m = map(int, input().split())
T = [[i for i in map(float, input().split())]for j in range(n)]
Location = [[i for i in map(int, input().split())]for j in range(m)]
for i in range(m):
a = Location[i][0]
b = Location[i][1]
sum = 1
xum = 0
out = []
for j in range(a-1, b):
type = T[j][0]
if type==1 :
sum *= T[j][1]
elif type==2 :
xum += T[j][1]
else:
print("数据读取错误!")
x = Location[i][2]
y = Location[i][3]
x = x*sum
y = y*sum
x1 = x*cos(xum)-y*sin(xum)
y1 = x*sin(xum)+y*cos(xum)
out.append(x1)
out.append(y1)
print(out[0], out[1])