Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Search for

# tetrahedron_ex2.cpp File Reference

`#include <SyFi.h>`

Go to the source code of this file.

## Functions
int | main ()

## Function Documentation

int main | ( |  | ) |

| Definition at line 5 of file tetrahedron_ex2.cpp. References EQUAL_OR_DIE(), Tetrahedron::integrate(), Tetrahedron::repr(), x, y, and z.
    00005            {
    00006
    00007   symbol x0("x0"), x1("x1"), y0("y0"), y1("y1"), z0("z0"), z1("z1");
    00008
    00009   ex p0 = lst(x0,y0,z0);
    00010   ex p1 = lst(x1,y0,z0);
    00011   ex p2 = lst(x0,y1,z0);
    00012   ex p3 = lst(x0,y0,z1);
    00013
    00014   Tetrahedron tetrahedron(p0,p1,p2,p3);
    00015
    00016   ex repr = tetrahedron.repr();
    00017   cout <<"t.repr "<<repr<<endl;
    00018   EQUAL_OR_DIE(repr, "{x==r*(x1-x0)+x0,y==y0+s*(-y0+y1),z==(z1-z0)*t+z0,{r,0,1},{s,0,1-r},{t,0,1-s-r}}");
    00019
    00020   ex f = x*y*z;
    00021   ex intf = tetrahedron.integrate(f);
    00022   cout <<"intf "<<intf<<endl;
    00023   EQUAL_OR_DIE(intf, "19/720*y0*x1*z0+1/144*z1*x0*y1+19/720*x0*z0*y1+1/144*y0*x1*z1+1/720*x1*z1*y1+19/720*y0*z1*x0+1/144*x1*z0*y1+47/720*y0*x0*z0");
    00024
    00025
    00026   return 0;
    00027 }