Given the side length, you can find the volume directly.
Derivation and proof process of Euler's four-dimensional Formula
1. x, y, and z Cartesian coordinate systems are recommended. Set the coordinates of A, B, and C to (A1, B1, C1), (A2, B2, C2), (A3, B3, C3 ), the six edges of the O-ABC are L, M, N, P, Q, R;
2. Because we don't know how to create a vector, I have inserted an image,
After this formula is used, the following result is obtained:
3. According to the Coordinate Expression of the vector quantity product and the definition of the quantity product
According to the cosine theorem
4. Bring the above formula into (1) and you will get the legendary Euler's guide formula. |
From: http://www.cnblogs.com/kuangbin/archive/2012/04/13/2446378.html
Code:
// # Pragma comment (linker, "/Stack: 16777216 ") // For C ++ Compiler # Include <stdio. h> # Include <Iostream> # Include <Cstring> # Include <Cmath> # Include <Stack> # Include <Queue> # Include <Vector> # Include <Algorithm> # Define Ll long# Define Max (A, B) (a)> (B ))? (A): (B )) # Define Min (A, B) (a) <(B ))? (A): (B )) # Define ABS (x)> 0 )? (X): (-(X ))) Using Namespace STD; Double P ( Double A, Double B, Double C, Double D, Double E ){ Return A * (B * c-d * E );} Double Eulertetrahedron ( Double Oa, Double OB, Double OC, Double AB, Double BC, Double CA) {OA * = OA; ob * = ob; OC * = OC; AB * = AB; Ca * = Ca; BC * = BC; Double Ans = 0 ; Ans + = P (OA, ob, OC, (OB + OC-BC )/ 2 ., (OB + OC-BC )/ 2 .); Ans -= P (OA + OB-AB )/ 2 ., (OA + OB-AB )/ 2 ., OC, (OA + OC-CA )/ 2 ., (OB + OC-BC )/ 2 .); Ans + = P (OA + OC-CA )/ 2 ., (OA + OB-AB )/ 2 ., (OB + OC-BC )/2 ., Ob, (OA + OC-CA )/ 2 .); Return SQRT (ANS/ 36 );} Int Main (){ Double Oa, ob, OC, AB, BC, CA; While (Scanf ( " % Lf " , & OA, & ob, & oC, & AB, & Ca, & BC )! =EOF) {printf ( " %. 4f \ n " , Euler (OA, ob, OC, AB, BC, CA ));} Return 0 ;}