Now that we have learned about Polar Coordinates,
it is relatively an easy leap to extend this into three dimensions - we simply
add the z dimensions and travel "upwards" along that axis to locate our point, just
as we would with normal three-dimensional Cartesian coordinates. This
combination of Polar Coordinates with a z dimension is called Cylindrical
Coordinates.
If you've already solved the previous problem on Polar Coordinates, then a similar
problem statement here would be quite trivial. Instead, you are to calculate the
total length of a line segment from the origin at (0, 0, 0) to a point given in Cylindrical
coordinates.
Try to observe how this problem is made simpler when the points are given in
Cylindrical coordinates r θ z, rather than Cartesian coordinates x y z.
Note that all values of θ are in degrees for this problem.
Input Data
First line will be Q, the quantity of testcases.
Q lines will follow, each describing a single point in the format r θ z.
Answer
Should consist of Q space-separated values, corresponding to the magnitudes of
the line segments between the origin and each point.
Error should be less than 1e-6
Example
input data:
2
1 0 1
-2.3 -45.6 -7.8
answer:
1.414214 8.132035