20 #ifndef LIBMESH_SPHERE_H 21 #define LIBMESH_SPHERE_H 207 const Real phi = std::atan2(c(1), c(0));
210 std::atan2( std::sqrt( c(0)*c(0) + c(1)*c(1) ), c(2) ),
219 const Real r = sph(0);
220 const Real theta = sph(1);
221 const Real phi = sph(2);
224 return Point ( r*std::sin(theta)*std::cos(phi) + this->
center()(0),
225 r*std::sin(theta)*std::sin(phi) + this->
center()(1),
226 r*std::cos(theta) + this->
center()(2));
234 #endif // LIBMESH_SPHERE_H
virtual bool above_surface(const Point &p) const override
A geometric object representing a sphere.
virtual Point surface_coords(const Point &cart) const override
virtual Point closest_point(const Point &p) const override
const Point & center() const
virtual bool on_surface(const Point &p) const override
Real distance(const Sphere &other_sphere) const
virtual Point unit_normal(const Point &p) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void create_from_center_radius(const Point &c, const Real r)
virtual Point world_coords(const Point &sph) const override
Base class for Plane and Sphere classes.
A geometric point in (x,y,z) space.
virtual bool below_surface(const Point &p) const override
bool intersects(const Sphere &other_sphere) const