83 static int n_no_spheres_;
84 static int n_probe_enclosed_by_a_sphere_;
85 static int n_probe_center_not_enclosed_;
86 static int n_surface_of_s0_not_covered_;
87 static int n_plane_totally_covered_;
88 static int n_internal_edge_not_covered_;
89 static int n_totally_covered_;
92 CS2Sphere(
const SCVector3& v,
double rad):
94 CS2Sphere(
double x,
double y,
double z,
double rad):
95 _v(x,y,z),_radius(rad){}
97 void initialize(
SCVector3& v,
double rad) {
98 _v = v; _radius = rad; }
100 CS2Sphere& operator=(
const CS2Sphere&s) {
101 _v = s._v; _radius = s._radius;
return *
this; }
105 double distance(CS2Sphere &asphere)
106 {
return sqrt((_v[0]-asphere._v[0])*(_v[0]-asphere._v[0])+
107 (_v[1]-asphere._v[1])*(_v[1]-asphere._v[1])+
108 (_v[2]-asphere._v[2])*(_v[2]-asphere._v[2]));}
112 double common_radius(CS2Sphere &asphere);
115 const SCVector3& center(
void)
const {
return _v; }
116 double x()
const {
return _v[0]; }
117 double y()
const {
return _v[1]; }
118 double z()
const {
return _v[2]; }
121 SCVector3 center_vec(
const CS2Sphere &asphere) {
return _v - asphere._v; }
123 double radius(
void)
const {
return _radius;}
125 void recenter(
const SCVector3 &v) { _v -= v; }
129 <<
scprintf(
"Rad=%lf, Center=(%lf,%lf,%lf), From origin=%lf\n",
130 _radius, _v[0], _v[1], _v[2], _v.norm());
137 int intersect(CS2Sphere *s,
138 int n_spheres)
const;
140 static void print_counts(std::ostream& =
ExEnv::out0());