Feel++ 0.91.0
|
#include <sphere.hpp>
Public Member Functions | |
Constructors, destructor | |
Sphere () | |
Sphere (Sphere const &s) | |
Sphere (const Point &c, const double r) | |
~Sphere () | |
Accessors | |
double | radius () const |
const Point & | center () const |
Mutators | |
void | setCenter (Point const &p) |
void | setRadius (double r) |
Methods | |
void | createFromCenterRadius (const Point &c, const double r) |
bool | intersects (const Sphere &other_sphere) const |
bool | aboveSurface (const Point &p) const |
bool | belowSurface (const Point &p) const |
bool | onSurface (const Point &p) const |
Point | closestPoint (const Point &p) const |
Point | unitNormal (const Point &p) const |
Point | surfaceCoords (const Point &cart) const |
Point | worldCoords (const Point &sph) const |
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 /
bool Feel::Sphere::aboveSurface | ( | const Point & | p | ) | const [inline, virtual] |
Implements Feel::Surface.
References center(), and radius().
Referenced by belowSurface().
bool Feel::Sphere::belowSurface | ( | const Point & | p | ) | const [inline, virtual] |
Implements Feel::Surface.
References aboveSurface().
const Point& Feel::Sphere::center | ( | ) | const [inline] |
Referenced by aboveSurface(), closestPoint(), intersects(), onSurface(), surfaceCoords(), unitNormal(), and worldCoords().
Implements Feel::Surface.
References center(), Feel::Geo0D< Dim, T >::node(), radius(), and unitNormal().
void Feel::Sphere::createFromCenterRadius | ( | const Point & | c, |
const double | r | ||
) | [inline] |
Defines a sphere of radius r centered at c.
References setCenter(), and setRadius().
bool Feel::Sphere::intersects | ( | const Sphere & | other_sphere | ) | const [inline] |
bool Feel::Sphere::onSurface | ( | const Point & | p | ) | const [inline, virtual] |
Implements Feel::Surface.
double Feel::Sphere::radius | ( | ) | const [inline] |
Returns the radius of the sphere.
Referenced by aboveSurface(), closestPoint(), intersects(), and onSurface().
void Feel::Sphere::setCenter | ( | Point const & | p | ) | [inline] |
set the center.
Referenced by createFromCenterRadius().
void Feel::Sphere::setRadius | ( | double | r | ) | [inline] |
set the radius
Referenced by createFromCenterRadius().
cart
. Reimplemented from Feel::Surface.
References center(), and Feel::Geo0D< Dim, T >::node().
Implements Feel::Surface.
References center(), and Feel::Geo0D< Dim, T >::node().
Referenced by closestPoint().
sph
. Reimplemented from Feel::Surface.
References center().