32 #include "DGtal/shapes/parametric/Ball3D.h"
33 #include "DGtal/helpers/StdDefs.h"
34 #include "DGtal/io/Color.h"
38 using namespace DGtal;
58 EuclideanShape ball1( c1, radius );
61 double arcExp = ball1.arclength( make_pair(0.0,0.0), make_pair(0.0,M_PI) ,500 );
62 double arcTheo = M_PI*radius;
63 trace.
info() <<
"Computed arc length: "<< arcExp <<endl;
64 trace.
info() <<
"Theoric arc length: "<< arcTheo << endl;
65 if(fabs(arcTheo- arcExp) < 0.1)
67 trace.
info() <<
"The arc length has a good value"<<endl;
76 double surfaceExp = ball1.surfacelength( make_pair(0.0,0.0), make_pair(M_PI*2,M_PI) ,500 );
77 double surfaceTheo = 4.0*M_PI*radius*radius;
78 trace.
info() <<
"Computed surface length: "<< surfaceExp <<endl;
79 trace.
info() <<
"Theoric surface length: "<< surfaceTheo << endl;
80 if(fabs(surfaceExp- surfaceTheo) < 0.1)
82 trace.
info() <<
"The surface has a good value"<<endl;
Aim: Model of the concept StarShaped3D represents any Sphere in the space.
Aim: Implements basic operations that will be used in Point and Vector classes.
void beginBlock(const std::string &keyword="")
DGtal is the top-level namespace which contains all DGtal functions and types.
bool test(const I &itb, const I &ite)