101 M_center( s.M_center ),
102 M_radius( s.M_radius )
189 FEELPP_ASSERT( r > 0 )( r ).error(
"radius negative" );
201 FEELPP_ASSERT( M_radius > 0 )( M_radius ).error(
"radius negative" );
202 FEELPP_ASSERT( other_sphere.
radius() > 0 )( other_sphere.
radius() ).error(
"radius negative" );
217 FEELPP_ASSERT( M_radius > 0 )( M_radius ).error(
"radius negative" );
219 if ( Feel::distance( p, this->
center() ) > this->
radius() )
244 FEELPP_ASSERT( M_radius > 0 )( M_radius ).error(
"radius negative" );
247 if ( std::abs( Feel::distance( p, this->
center() ) - this->
radius() ) < 1.e-10 )
259 FEELPP_ASSERT( M_radius > 0 )( M_radius ).error(
"radius negative" );
279 FEELPP_ASSERT( M_radius > 0 )( M_radius ).error(
"radius negative" );
302 const double phi = std::atan2( c( 1 ), c( 0 ) );
305 std::atan2( std::sqrt( c( 0 )*c( 0 ) + c( 1 )*c( 1 ) ), c( 2 ) ),
306 ( ( phi < 0 ) ? 2.*M_PI+phi : phi ) );
316 const double r = sph( 0 );
317 const double theta = sph( 1 );
318 const double phi = sph( 2 );
321 return Point ( r*std::sin( theta )*std::cos( phi ) + this->
center()( 0 ),
322 r*std::sin( theta )*std::sin( phi ) + this->
center()( 1 ),
323 r*std::cos( theta ) + this->
center()( 2 ) );
const Point & center() const
Definition: sphere.hpp:147
bool onSurface(const Point &p) const
Definition: sphere.hpp:242
bool intersects(const Sphere &other_sphere) const
Definition: sphere.hpp:199
bool aboveSurface(const Point &p) const
Definition: sphere.hpp:215
Definition: surface.hpp:48
Definition: sphere.hpp:74
double radius() const
Definition: sphere.hpp:138
void setRadius(double r)
Definition: sphere.hpp:172
Geo0D const & node() const
Definition: geo0d.hpp:245
void setCenter(Point const &p)
Definition: sphere.hpp:164
Point closestPoint(const Point &p) const
Definition: sphere.hpp:257
Point surfaceCoords(const Point &cart) const
Definition: sphere.hpp:296
void createFromCenterRadius(const Point &c, const double r)
Definition: sphere.hpp:187
bool belowSurface(const Point &p) const
Definition: sphere.hpp:230
Point unitNormal(const Point &p) const
Definition: sphere.hpp:277
Point worldCoords(const Point &sph) const
Definition: sphere.hpp:314