问题描述
输入:
将n个协调点作为inut
并根据我们的意愿根据x,y轴反映它们,并计算每个象限中的点数.
样本输入:
输入点数
4
1 1
1 -1
-1 -1
-1 1
输入操作次数
4
x 1 3(根据x轴表示第一,第二,第三点)
数1 3
y 1 2
数1 3
样本输出:
q1 q2 q3 q4
1 1 0 2
0 0 1 3
input:
takes n coordinating points as inut
and reflects them according to x,y axis depending of our wish and counts number of points in each quadrant.
sample input:
enter number of points
4
1 1
1 -1
-1 -1
-1 1
enter number of opperations
4
x 1 3(means reflects first,second,third points according to x-axis)
count 1 3
y 1 2
count 1 3
sample output:
q1 q2 q3 q4
1 1 0 2
0 0 1 3
推荐答案
x -> -x
就这样.
另请参阅: http://en.wikipedia.org/wiki/Coordinate_transformation#Transformations_between_coordinate_systems [ ^ ].
That''s it.
See also: http://en.wikipedia.org/wiki/Coordinate_transformation#Transformations_between_coordinate_systems[^].
这篇关于反映协调点的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!