HDU 1411 Anniversary Mystery Building (Euler tetrahedron formula)

Source: Internet
Author: User

HDU 1411:http://acm.hdu.edu.cn/showproblem.php?pid=1411

The person is one of you a hexahedral six sides, seek hexahedral volume.

Train of thought: there is no idea, is to use Euler tetrahedron formula directly into.

Euler Tetrahedron formula:

There are a lot of specific derivation online.  eg. http://blog.csdn.net/archibaldyangfan/article/details/8035332

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/

void Solve ()
{
    Double A, B, C, M, N, l;
    scanf ("%lf%lf%lf%lf%lf%lf", &a, &c, &b, &n, &l, &m);
    Double V = (double) sqrt (4.0*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)-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))/12.0;
    printf ("%.4lf\n", V);
}
  
HDU 1411

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.