A geometric object representing a sphere. More...
#include <sphere.h>
Public Member Functions | |
Sphere () | |
Sphere (const Point &c, const Real r) | |
Sphere (const Point &, const Point &, const Point &, const Point &) | |
Sphere (const Sphere &other_sphere) | |
~Sphere () | |
void | create_from_center_radius (const Point &c, const Real r) |
bool | intersects (const Sphere &other_sphere) const |
Real | distance (const Sphere &other_sphere) const |
virtual bool | above_surface (const Point &p) const override |
virtual bool | below_surface (const Point &p) const override |
virtual bool | on_surface (const Point &p) const override |
virtual Point | closest_point (const Point &p) const override |
virtual Point | unit_normal (const Point &p) const override |
Real | radius () const |
Real & | radius () |
const Point & | center () const |
Point & | center () |
virtual Point | surface_coords (const Point &cart) const override |
virtual Point | world_coords (const Point &sph) const override |
Private Attributes | |
Point | _cent |
Real | _rad |
A geometric object representing a sphere.
This class defines a sphere. It also computes coordinate transformations between cartesian and spherical coordinates. The spherical coordinates are valid in the ranges:
The coordinates are related as follows: is the angle in the xy plane starting with 0. from the positive x axis, is measured against the positive z axis.
* * \ | Z * \theta| * \ | . * \ | . * \ | . * \ | . * \|. * --------------+---------.--------- * /|\ . Y * /phi\ . * / | \ . * / | \ . * /.........\ * / | * X / *
libMesh::Sphere::Sphere | ( | ) |
Dummy Constructor.
Constructs a sphere of radius r centered at c.
Definition at line 43 of file sphere.C.
References create_from_center_radius().
Constructs a sphere connecting four points.
Definition at line 62 of file sphere.C.
References std::abs(), create_from_center_radius(), libMesh::TypeTensor< T >::det(), libMesh::TypeVector< T >::norm_sq(), and libMesh::Real.
libMesh::Sphere::Sphere | ( | const Sphere & | other_sphere | ) |
Copy-constructor.
Definition at line 53 of file sphere.C.
References center(), create_from_center_radius(), and radius().
libMesh::Sphere::~Sphere | ( | ) |
|
overridevirtual |
true
if the point p is above the surface, false otherwise. Implements libMesh::Surface.
Definition at line 140 of file sphere.C.
References center(), libMesh::TypeVector< T >::norm(), and radius().
Referenced by below_surface().
|
overridevirtual |
true
if the point p is below the surface, false otherwise. Implements libMesh::Surface.
Definition at line 155 of file sphere.C.
References above_surface(), and radius().
|
inline |
Definition at line 163 of file sphere.h.
References _cent.
Referenced by above_surface(), closest_point(), create_from_center_radius(), distance(), on_surface(), Sphere(), surface_coords(), unit_normal(), and world_coords().
|
inline |
Implements libMesh::Surface.
Definition at line 181 of file sphere.C.
References center(), radius(), and unit_normal().
Definition at line 128 of file sphere.C.
References center(), radius(), and libMesh::Real.
Referenced by intersects().
bool libMesh::Sphere::intersects | ( | const Sphere & | other_sphere | ) | const |
true
if other_sphere intersects this sphere, false otherwise. Definition at line 121 of file sphere.C.
References distance().
|
overridevirtual |
true
if the point p is on the surface, false otherwise.Implements libMesh::Surface.
Definition at line 164 of file sphere.C.
References std::abs(), center(), libMesh::TypeVector< T >::norm(), and radius().
|
inline |
Definition at line 153 of file sphere.h.
References _rad.
Referenced by above_surface(), below_surface(), closest_point(), create_from_center_radius(), distance(), on_surface(), Sphere(), and unit_normal().
|
inline |
cart
. Reimplemented from libMesh::Surface.
Definition at line 201 of file sphere.h.
References center(), libMesh::TypeVector< T >::norm(), libMesh::pi, and libMesh::Real.
Implements libMesh::Surface.
Definition at line 198 of file sphere.C.
References center(), radius(), and libMesh::TypeVector< T >::unit().
Referenced by closest_point().
sph
. Reimplemented from libMesh::Surface.
Definition at line 217 of file sphere.h.
References center(), and libMesh::Real.
|
private |
|
private |