triangle_ex3.cpp
Go to the documentation of this file.00001 #include <SyFi.h>
00002
00003 using namespace GiNaC;
00004 using namespace SyFi;
00005 using namespace std;
00006
00007 int main() {
00008
00009 initSyFi(3);
00010
00011
00012
00013 numeric h(1,100);
00014 numeric a(1,2);
00015 ex p0 = lst(a,a,a);
00016 ex p1 = lst(a+h,a,a);
00017 ex p2 = lst(a,a+h,a);
00018
00019 Triangle triangle(p0,p1,p2);
00020
00021
00022 ex f = 1;
00023 ex intf = triangle.integrate(f);
00024 cout <<"intf "<<intf<<endl;
00025 EQUAL_OR_DIE(intf, "1/20000");
00026
00027 return 0;
00028 }
00029