line_ex1.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 line_ex1.cpp.

References EQUAL_OR_DIE(), Line::integrate(), Line::repr(), x, y, and z.

00005            {
00006 
00007   
00008   ex p0 = lst(0.0,0.0,0.0);
00009   ex p1 = lst(1.0,1.0,1.0);
00010   
00011   Line line(p0,p1);
00012   
00013   // show usage of repr 
00014   symbol t("t"); 
00015   ex l_repr = line.repr(t);
00016   cout <<"l.repr "<<l_repr<<endl; 
00017   EQUAL_OR_DIE(l_repr, "{x==t,y==t,z==t,{t,0,1}}"); 
00018 
00019   for (int i=0; i< l_repr.nops(); i++) {
00020     cout <<"l_repr.op(" <<i<<"):  "<<l_repr.op(i)<<endl; 
00021   }
00022   
00023   // compute the integral of a function along the line 
00024   ex f = x*x + y*y*y + z;
00025   ex intf = line.integrate(f); 
00026   cout <<"intf "<<intf<<endl; 
00027   EQUAL_OR_DIE(intf, "13/12*sqrt(3)"); 
00028 
00029 
00030 
00031   return 0; 
00032 
00033 }


Generated on Wed Apr 19 12:38:14 2006 for SyFi by  doxygen 1.4.4