102591: [AtCoder]ABC259 B - Counterclockwise Rotation
Description
Score : $200$ points
Problem Statement
In an $xy$-coordinate plane whose $x$-axis is oriented to the right and whose $y$-axis is oriented upwards, rotate a point $(a, b)$ around the origin $d$ degrees counterclockwise and find the new coordinates of the point.
Constraints
- $-1000 \leq a,b \leq 1000$
- $1 \leq d \leq 360$
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
$a$ $b$ $d$
Output
Let the new coordinates of the point be $(a', b')$. Print $a'$ and $b'$ in this order, with a space in between.
Your output will be considered correct when, for each value printed, the absolute or relative error from the answer is at most $10^{-6}$.
Sample Input 1
2 2 180
Sample Output 1
-2 -2
When $(2, 2)$ is rotated around the origin $180$ degrees counterclockwise, it becomes the symmetric point of $(2, 2)$ with respect to the origin, which is $(-2, -2)$.
Sample Input 2
5 0 120
Sample Output 2
-2.49999999999999911182 4.33012701892219364908
When $(5, 0)$ is rotated around the origin $120$ degrees counterclockwise, it becomes $(-\frac {5}{2} , \frac {5\sqrt{3}}{2})$.
This sample output does not precisely match these values, but the errors are small enough to be considered correct.
Sample Input 3
0 0 11
Sample Output 3
0.00000000000000000000 0.00000000000000000000
Since $(a, b)$ is the origin (the center of rotation), a rotation does not change its coordinates.
Sample Input 4
15 5 360
Sample Output 4
15.00000000000000177636 4.99999999999999555911
A $360$-degree rotation does not change the coordinates of a point.
Sample Input 5
-505 191 278
Sample Output 5
118.85878514480690171240 526.66743699786547949770
Input
题意翻译
在一个平面直角坐标系中,有一点 $(a,b)$,请输出它绕原点逆时针旋转 $d$ 度后的新坐标。 每个值的绝对或相对误差最大为 $10^{-6}$ 的答案视为正确。Output
题目描述
在一个$x$轴向右、$y$轴向上的坐标平面上,将点$(a, b)$围绕原点逆时针旋转$d$度,找出新点的坐标。
约束条件
- $-1000 \leq a,b \leq 1000$
- $1 \leq d \leq 360$
- 输入中的所有值都是整数。
输入
从标准输入中按照以下格式给出输入:
$a$ $b$ $d$
输出
令新点的坐标为$(a', b')$。按顺序打印$a'$和$b'$,其间用空格隔开。
当每个输出值与答案之间的绝对或相对误差不超过$10^{-6}$时,您的输出将被认为是正确的。
样例输入 1
2 2 180
样例输出 1
-2 -2
当$(2, 2)$围绕原点逆时针旋转$180$度时,它变成了$(2, 2)$关于原点的对称点,即$(-2, -2)$。
样例输入 2
5 0 120
样例输出 2
-2.49999999999999911182 4.33012701892219364908
当$(5, 0)$围绕原点逆时针旋转$120$度时,它变成了$(-\frac {5}{2} , \frac {5\sqrt{3}}{2})$。
这个样例输出与这些值并不完全一致,但是误差足够小,被认为是正确的。
样例输入 3
0 0 11
样例输出 3
0.00000000000000000000 0.00000000000000000000
因为$(a, b)$是原点(旋转中心),旋转不会改变其坐标。
样例输入 4
15 5 360
样例输出 4
15.00000000000000177636 4.99999999999999555911
一个$360$度的旋转不会改变点的坐标。
样例输入 5
-505 191 278
样例输出 5
118.85878514480690171240 526.66743699786547949770