Dihedral Angle
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Dihedral angle is the angle between two intersecting planes. Considering two planes \pi_1 and \pi_2, we name the intersection line of the two planes as AB, a point on \pi_2 to be C, and a point on \pi_1 to be D, then we can describe one dihedral angle between \pi_1 and \pi_2 to be dihedral angle C-AB-D or D-AB-C. In addtion, the range of dihedral angles is [0^{\circ}, 180^{\circ}) which differs dihedral angle from the smallest angle between two planes whose range is [0^{\circ}, 90^{\circ}).


Now, given the x,y,z coordinates of four points A,B,C and D, your task is to calculate the degree of dihedral angle A-BC-D.
Here we provide a formula of dihedral angle which might be useful, and we assume \overrightarrow {n_{ABC}} to be the normal vector of plane ABC, which is a vector perpendicular to the plane ABC.

\left | \cos \angle A-BC-D \right \vert = \left | \frac{ \overrightarrow {n_{ABC}} \bullet \overrightarrow {n_{BCD}} }{ \left | \overrightarrow {n_{ABC}}\right \vert \bullet \left | \overrightarrow {n_{BCD}}\right \vert }\right \vert

输入描述:

The first line contains three integers x_A,y_A,z_A, the x,y,z coordinates for point A.

The second line contains three integers x_B,y_B,z_Bthe x,y,z coordinates for point B.

The third line contains three integers x_C,y_C,z_Cthe x,y,z coordinates for point C.

The fourth line contains three integers x_D,y_D,z_Dthe x,y,z coordinates for point D.

It is also guarenteed that all the coordinates are in range [ -10^4 , 10^4], and none of the points have same x,y,z coordinates.

输出描述:

Please output the degree of dihedral angle A-BC-D after rounding.
示例1

输入

复制
1 0 2
0 0 0
2 0 0
1 2 0

输出

复制
90
示例2

输入

复制
0 -1 1
0 0 0
2 0 0
1 2 0

输出

复制
135

备注:

About rounding:
  • If the first digit after the decimal point is less than 5, round the number you're considering down.
  • If the first digit after the decimal point is more or equal to 5, round the number you're considering up.