tetrahedron_ex2.cpp

Go to the documentation of this file.
00001 #include <SyFi.h> 
00002 
00003 int main() {
00004 
00005   symbol x0("x0"), x1("x1"), y0("y0"), y1("y1"), z0("z0"), z1("z1"); 
00006   
00007   ex p0 = lst(x0,y0,z0);
00008   ex p1 = lst(x1,y0,z0);
00009   ex p2 = lst(x0,y1,z0);
00010   ex p3 = lst(x0,y0,z1);
00011 
00012   Tetrahedron tetrahedron(p0,p1,p2,p3);
00013   
00014   ex repr = tetrahedron.repr();
00015   cout <<"t.repr "<<repr<<endl; 
00016   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}}"); 
00017   
00018   ex f = x*y*z;
00019   ex intf = tetrahedron.integrate(f); 
00020   cout <<"intf "<<intf<<endl; 
00021   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");   
00022 
00023   
00024   return 0; 
00025 }
00026 

Generated on Tue Nov 22 11:10:22 2005 for SyFi by  doxygen 1.4.4