# POJ 2208 Pyramids 欧拉四面体

2010-08-16 14:18

 1，建议x，y，z直角坐标系。设A、B、C少拿点的坐标分别为(a1,b1,c1),(a2,b2,c2),(a3,b3,c3),四面体O-ABC的六条棱长分别为l，m，n，p，q，r； 2，四面体的体积为，由于现在不知道向量怎么打出来，我就插张图片了， 将这个式子平方后得到： 3，根据矢量数量积的坐标表达式及数量积的定义得 又根据余弦定理得 4，将上述的式子带入（1），就得到了传说中的欧拉四面体公式

```//#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 long
#define Max(a,b) (((a) > (b)) ? (a) : (b))
#define Min(a,b) (((a) < (b)) ? (a) : (b))
#define Abs(x) (((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%lf%lf%lf%lf%lf",&OA,&OB,&OC,&AB,&CA,&BC)!=EOF ){
printf("%.4f\n",euler(OA, OB, OC, AB, BC, CA));
}
return 0;
}```

POJ 2208 Pyramids 欧拉四面体,布布扣,bubuko.com

## POJ 2208 已知空间四面体六条边长度，求体积

Pyramids Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2718   Accepted: 886   Special Judge Description Recently in Farland, a country in Asia, a famous scientist Mr. Log Archeo has discovered ancient pyramids. But unlike those in Egyp

## [POJ 2407]Relatives(欧拉函数)

Description Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0 such that a = xy and b = xz. Input There are several

## POJ 1284-Primitive Roots(欧拉函数求原根)

Primitive Roots Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1284 Appoint description:  System Crawler  (2015-04-06) Description We say that integer x, 0 < x < p, is a primitive root mod