Your task is simple: given some points in 3D, rotate them around an axis of rotation.
Input Specification
The first line of input will contain , the number of test cases
.
The next lines will each contain 7 real numbers to 6 decimal places,
. You are to rotate the point
around the axis of rotation
such that if you look at the origin from the axis of rotation, it will be rotated
radians counterclockwise. All coordinates will have absolute value of at most
and
will be such that
. It is guaranteed at least one of
is nonzero.
Output Specification
Output lines, each line should have the
, the result of rotation as three space-separated real numbers. Your answer will be judged as correct if it is within an absolute or relative error of
.
Sample Input
2
0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 3.141593
1.000000 0.000000 0.000000 1.000000 1.000000 1.000000 1.570796
Sample Output
0.000000 0.000000 0.000000
0.333334 0.910683 -0.244017
Comments