31 #include "DGtal/shapes/parametric/Ball3D.h"
32 #include "DGtal/helpers/StdDefs.h"
34 #include "DGtal/io/Color.h"
35 #include "DGtal/kernel/sets/SetPredicate.h"
39 using namespace DGtal;
46 int main(
int ,
char** )
59 RealPoint c1(0, 0, 0 );
60 EuclideanShape ball1( c1, radius );
63 double arcExp = ball1.arclength( make_pair(0.0,0.0), make_pair(0.0,M_PI) ,500 );
64 double arcTheo =
M_PI*radius;
65 trace.
info() <<
"Computed arc length: "<< arcExp <<endl;
66 trace.
info() <<
"Theoric arc length: "<< arcTheo << endl;
67 if(fabs(arcTheo- arcExp) < 0.1)
69 trace.
info() <<
"The arc length has a good value"<<endl;
78 double surfaceExp = ball1.surfacelength( make_pair(0.0,0.0), make_pair(M_PI*2,M_PI) ,500 );
79 double surfaceTheo = 4.0*
M_PI*radius*radius;
80 trace.
info() <<
"Computed surface length: "<< surfaceExp <<endl;
81 trace.
info() <<
"Theoric surface length: "<< surfaceTheo << endl;
82 if(fabs(surfaceExp- surfaceTheo) < 0.1)
84 trace.
info() <<
"The surface has a good value"<<endl;