Rotation Transformation
시간 제한2초메모리 제한1024 MB
3x3 회전 행렬이 주어질 때 회전각을 도 단위로, 그리고 단위 회전축 벡터를 복원하는 문제다.
문제
A simple motion over and over...
t.A.T.u., <<A Simple Motion>>
Julia loves simple motions very much especially in three-dimensional space! Recently she found a matrix that corresponds with some rotation around an axis that goes through the origin. Rotation is defined by unit vector and rotation angle .
Suppose you look at the origin from the end of then if rotation is going counter-clockwise then will be positive, negative overwise.
Rotation matrix moves point to like this:
Unfortunately Julia doesn't know values of and , so she asked you to restore them and then she will continue her simple motion.
입력
You are given matrix . It is guaranteed that there is such rotation matrix that .
출력
First line should contain in degrees. Second line should contain coordinates of unit vector . It is guaranteed that . Output all number as precise as you can. Your answer will be considered correct if the difference between and the matrix constructed from your angle and unit vector will not exceed .