当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5388:Geometer's Sketchpad

Special Judge 特殊评判
题目描述
The Geometer's Sketchpad is a popular commercial interactive geometry software program for exploring Euclidean geometry, algebra, calculus, and other areas of mathematics.

The Geometer's Sketchpad can solve most problems of plane geometry and plane analytic geometry, but it's powerless to solve solid geometry problems. Therefore, the famous mathematician BG, decided to develop a new software, named The Geometer's Sketchpad 3D.

Because of the huge amount of work to do, BG decided to start from basic three-dimensional transformations. Similar to two-dimensional transformations, three-dimensional transformations include three basic types:
1. Translation.



2. Scaling.



3. Rotation.




Now there are $n$ points $P_1,P_2,P_3,\ldots,P_n$ in the three-dimensional space, and BG wanted to implement the following several transformation operations:
1. For given integers $l,r,x,y,z$, translate points $P_l,P_{l+1},P_{l+2},\ldots,P_r$ by the vector $(x,y,z)$ at the same time;
2. For given integers $l,r,x,y,z$ and the real number $k$, scale points $P_l,P_{l+1},P_{l+2},\ldots,P_r$ by the scale factor $k$ and the center point $(x,y,z)$ at the same time;
3. For given integers $l,r,x,y,z,x',y',z'$ and the real number $\theta$, rotate points $P_l,P_{l+1},P_{l+2},\ldots,P_r$ counterclockwise around the axis determined by the point $(x,y,z)$ and the direction vector $(x',y',z')$ through an angle $\theta$ (in radian) at the same time.

In addition, there are some measurement operations:
1. For given integer $i$, calculate the current coordinates of the point $P_i$;
2. For given integers $l,r$, calculate the current length of the polygonal chain $P_{l}P_{l+1}P_{l+2}\cdots P_{r}$. In other words, just calculate $|P_lP_{l+1}|+|P_{l+1}P_{l+2}|+\cdots+|P_{r-1}P_r|$, where $|PQ|$ means the Euclidean distance between points $P$ and $Q$.
输入解释
There are multiple test cases.

For each test case:

The first line contains two positive integers $n,m~(1\le n,m \le 222222)$, representing the number of points and the number of operations.

Next $n$ lines, each line contains three integers $x,y,z$, representing a point $(x,y,z)$ in the three-dimensional space.

Next $m$ lines, each line describes an operation (without quotes):
1. "$\mathtt{Translation}~l~r~x~y~z$", translate points;
2. "$\mathtt{Scaling}~l~r~x~y~z~k$", scale points;
3. "$\mathtt{Rotation}~l~r~x~y~z~x'~y'~z'~\theta$", rotate points;
4. "$\mathtt{Coordinates}~i$", calculate the current coordinates of the point;
5. "$\mathtt{Length}~l~r$", calculate the current length of the polygonal chain.

There is one blank line between successive tests. Values of $n=m=0$ indicate end of input.

For the all of the above variables, $1 \le l,r,i \le n$, $-1000 \le x,y,z,x',y',z' \le 1000$, $0 < k \le 2$, $-10 \le \theta \le 10$. $k$ and $\theta$ are real numbers, given with at most $6$ digits after the decimal point, and all other numbers are integers. You can sure that the absolute value of the answer does not exceed $10^{10}$ at any time.

It is guaranteed $\sum n+\sum m \le 10^6$.
输出解释
For each test case:

First output one line containing "$\texttt{Case #}i\texttt{:}$"(without quotes), where $i$ is the test case number (starting from $1$).

Then, for each "$\mathtt{Coordinates}$" operator, output one line containing three space-separated real numbers, representing the current coordinates of the point; for each "$\mathtt{Length}$" operator, output one line containing a real number, representing the current length of the polygonal chain.

Your output will be considered correct if the absolute or relative error of every number does not exceed $10^{-4}$.
输入样例
5 10
0 0 0
2 0 0
2 1 0
0 1 0
0 0 0
Translation 1 5 1 1 0
Scaling 2 4 1 1 0 2
Coordinates 2
Coordinates 3
Length 2 3
Rotation 1 5 0 0 0 0 0 1 1.570796
Translation 1 2 0 0 100
Coordinates 2
Coordinates 3
Length 2 3

0 0
输出样例
Case #1:
5.0000 1.0000 0.0000
5.0000 3.0000 0.0000
2.0000
-1.0000 5.0000 100.0000
-3.0000 5.0000 0.0000
100.0200
来自杭电HDUOJ的附加信息
Author SXYZ
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5388

最后修改于 2020-10-25T23:22:15+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
30000/15000MS(Java/Others) 262144/262144K(Java/Others)