Poj 2208 pyramids

Source: Internet
Author: User

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  ;} 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.