POJ2208给定四面体六条棱(有序)的长度 求体积

显然用高中立体几何的方法就可以解决。

给出代码

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<vector>
using namespace std;
double Volume(double l,double n,double a,double m,double b,double c)
{
double x,y;
x=4*a*a*b*b*c*c-a*a*(b*b+c*c-m*m)*(b*b+c*c-m*m)-b*b*(c*c+a*a-n*n)*(c*c+a*a-n*n);
y=c*c*(a*a+b*b-l*l)*(a*a+b*b-l*l)-(a*a+b*b-l*l)*(b*b+c*c-m*m)*(c*c+a*a-n*n);
return(sqrt(x-y)/12.);
}
int main()
{freopen("t.txt","r",stdin);
double l1,l2,l3,l4,l5,l6;
cin>>l1>>l2>>l3>>l4>>l5>>l6;
printf("%.4lf\n",Volume(l1,l2,l3,l4,l5,l6)+0.0000005);
return 0;
}

  

POJ2208 Pyramids 四面体体积的更多相关文章

  1. POJ 2208 Pyramids(求四面体体积)

    Description Recently in Farland, a country in Asia, a famous scientist Mr. Log Archeo has discovered ...

  2. MT【243】球内接四面体体积

    已知半径为2的球面上有$A,B,C,D$四点,若$AB=CD=2$,则四面体$ABCD$的体积最大为____ 解答:利用$V=\dfrac{1}{6}|AB||CD|d<AB,CD>sin ...

  3. HDU 1411--校庆神秘建筑(欧拉四面体体积计算)

    校庆神秘建筑 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Subm ...

  4. POJ 2208--Pyramids(欧拉四面体体积计算)

    Pyramids Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 3451   Accepted: 1123   Specia ...

  5. HDU1411++几何+四面体体积

    公式题... 自己闲的用cos sin推出个公式 还不知道对不对,明天补上.. #include<stdio.h> #include<math.h> #include<i ...

  6. HDU #5733 tetrahedron

    tetrahedron 传送门 Time Limit: 2000/1000 MS (Java/Others)   Memory Limit: 65536/65536 K (Java/Others) P ...

  7. [Sdoi2016]平凡的骰子

    描述 这是一枚平凡的骰子.它是一个均质凸多面体,表面有n个端点,有f个面,每一面是一个凸多边形,且任意两面不共面.将这枚骰子抛向空中,骰子落地的时候不会发生二次弹跳(这是一种非常理想的情况).你希望知 ...

  8. 【LOJ】#2070. 「SDOI2016」平凡的骰子

    题解 用了一堆迷之复杂的结论结果迷之好写的计算几何???? 好吧,要写立体几何了 如果有名词不懂自己搜吧 首先我们求重心,我们可以求带权重心,也就是x坐标的话是所有分割的小四面体的x坐标 * 四面体体 ...

  9. 【Vijos 1998】【SDOI 2016】平凡的骰子

    https://vijos.org/p/1998 三维计算几何. 需要混合积求四面体体积: 四面体剖分后合并带权重心求总重心: 四面体重心的横纵坐标是四个顶点的横纵坐标的平均数: 三维差积求平面的法向 ...

随机推荐

  1. Kvm:通过 libvirt 远程管理虚拟机

    1.通过qemu+ssh方式 2.通过qemu+tcp方式 主控端需要安装相关工具包: #yum groupinstall "Virtualization" #yum instal ...

  2. ORM之连表操作

    ORM之连表操作 -----------------------------连表的正向操作------------------------- 在models.py中创建两张表UserType和User ...

  3. 语法,if,while循环,for循环

    目录 一.语法 二.while循环 三.for循环 一.语法 if: if判断其实是在模拟人做判断.就是说如果这样干什么,如果那样干什么.对于ATM系统而言,则需要判断你的账号密码的正确性. if 条 ...

  4. CodeForcesGym 100517I IQ Test

    IQ Test Time Limit: 2000ms Memory Limit: 262144KB This problem will be judged on CodeForcesGym. Orig ...

  5. BNUOJ 6719 Simpsons’ Hidden Talents

    Simpsons’ Hidden Talents Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on HDU ...

  6. CF601D:Acyclic Organic Compounds

    给n<=300000的树,每个点上有一个字母,一个点的权值为:从该点出发向下走到任意节点停下形成的不同字符串的数量,问最大权值. 题目本身还有一些奇怪要求在此忽略.. Trie合并的模板题. # ...

  7. ****Call to a member function item() on a non-object

    A PHP Error was encountered Severity: Error Message: Call to a member function item() on a non-objec ...

  8. [TypeScript] Define Custom Type Guard Functions in TypeScript

    One aspect of control flow based type analysis is that the TypeScript compiler narrows the type of a ...

  9. [Web Analytics] Into to Web Analytics

    Just to get started for myself. Any developer who doesn't care about the business is not a good soft ...

  10. luajit利用ffi结合C语言实现面向对象的封装库

    luajit中.利用ffi能够嵌入C.眼下luajit的最新版是2.0.4,在这之前的版本号我还不清楚这个扩展库详细怎么样,只是在2.04中,真的非常爽.  既然是嵌入C代码.那么要说让lua支持 ...