43 typedef pair<double,double> AngularCoordinates;
56 myRadius(radius), myCenter(x0,y0,z0)
63 myRadius(radius), myCenter(aPoint)
87 if((fabs(l[0])<0.0001)&&(fabs(l[1])<0.0001))
98 angle.first=atan2(l[1],l[0]);
100 angle.first=atan2(l[1],l[0])+
M_PI*2.0;
101 angle.second=acos(sqrt(l[2]*l[2])/sqrt(l[0]*l[0]+l[1]*l[1]+l[2]*l[2]));
112 template <
typename T>
117 RealPoint c( myRadius*cos(t.first)*sin(t.second), myRadius*sin(t.first)*sin(t.second) , myRadius*cos(t.second));
129 template <
typename T>
135 double xx=2*(p[0]-myCenter[0]);
136 double yy =2*(p[1]-myCenter[1]);
137 double zz=2*(p[2]-myCenter[2]);
146 template <
typename T>
151 return RealPoint(-myRadius*sin(t.first)*sin(t.second),myRadius*cos(t.first)*sin(t.second),0);
161 template <
typename T>
166 return RealPoint(myRadius*cos(t.first)*cos(t.second),myRadius*sin(t.first)*cos(t.second),-myRadius*sin(t.second));
175 template <
typename T>
180 return RealPoint(-myRadius*cos(t.first)*sin(t.second),-myRadius*sin(t.first)*sin(t.second),0);
190 template <
typename T>
195 return RealPoint(-myRadius*cos(t.first)*sin(t.second),-myRadius*sin(t.first)*sin(t.second),-myRadius*cos(t.second));
203 template <
typename T>
208 return RealPoint(-myRadius*sin(t.first)*cos(t.second),myRadius*cos(t.first)*cos(t.second),0);
221 template <
typename T>
226 out <<
"[Ball3D] center= "<<myCenter<<
" radius="<<myRadius;
233 template <
typename T>
248 template <
typename T>
254 object.selfDisplay( out );