00001 #include <SyFi.h>
00002
00003 using namespace GiNaC;
00004
00005 int main() {
00006
00007 ex p0 = lst(0.0,0.0,1.0);
00008 ex p1 = lst(1.0,0.0,1.0);
00009 ex p2 = lst(0.0,1.0,1.0);
00010
00011 Triangle triangle(p0,p1,p2);
00012
00013 ex repr = triangle.repr();
00014 cout <<"t.repr "<<repr<<endl;
00015 EQUAL_OR_DIE(repr, "{x==r,y==s,z==1.0,{r,0,1},{s,0,1-r}}");
00016
00017 ex f = x*y*z;
00018 ex intf = triangle.integrate(f);
00019 cout <<"intf "<<intf<<endl;
00020 EQUAL_OR_DIE(intf, "1/24");
00021
00022 return 0;
00023 }
00024