![]() |
Parasol Planning Library (PPL)
|
#include <NSphericalShell.h>
Public Member Functions | |
Construction | |
NSphericalShell (const size_t _n, const double _outer=std::numeric_limits< double >::max(), const double _inner=0) | |
NSphericalShell (const std::vector< double > &_center, const double _outer=std::numeric_limits< double >::max(), const double _inner=0) | |
virtual | ~NSphericalShell () noexcept |
Accessors | |
size_t | GetDimension () const noexcept |
Get the dimension of this sphere. More... | |
void | SetCenter (const std::vector< double > &_c) noexcept |
const std::vector< double > & | GetCenter () const noexcept |
Get the center point. More... | |
double | GetOuterRadius () const noexcept |
Get the outer radius. More... | |
double | GetInnerRadius () const noexcept |
Get the inner radius. More... | |
void | SetOuterRadius (const double _r) noexcept |
Set the outer radius. More... | |
void | SetInnerRadius (const double _r) noexcept |
Set the inner radius. More... | |
void | Translate (const std::vector< double > &_v) noexcept |
double | GetVolume () const noexcept |
Compute the (hyper)volume or Lebesgue measure. More... | |
Point Testing | |
If the sphere and point have different dimensions, the missing values will be assumed to be 0. | |
bool | Contains (const std::vector< double > &_p) const noexcept |
double | Clearance (std::vector< double > _p) const noexcept |
std::vector< double > | ClearancePoint (std::vector< double > _p) const noexcept |
Sampling | |
std::vector< double > | Sample () const |
Friends | |
std::istream & | operator>> (std::istream &_is, NSphericalShell &_sphere) |
A general representation of a spherical shell volume in N dimensions (i.e., a spherical volume with an outer and inner radius).
Like NSphere, this object also models the inscribed hyper-volume.
|
explicit |
Construct an n-spherical shell at the origin with a given dimension and radius.
_n | The dimension. |
_outer | The outer radius (infinite by default). |
_inner | The inner radius (0 by default). |
|
explicit |
Construct an n-spherical shell with a given center point and radius.
_c | The center point, which is assumed to be of full dimension. |
_outer | The outer radius (infinite by default). |
_inner | The inner radius (0 by default). |
|
virtualdefaultnoexcept |
|
noexcept |
Compute the minimum distance to the sphere's surface from a given point. This is bounding-sphere style, so clearance is positive if the point is inside the sphere and negative if it is outside.
_p | The point of interest. |
|
noexcept |
Find the point on the sphere that is nearest to a given reference point.
_p | The reference point. |
|
noexcept |
Test if a given point lies within the n-spherical shell.
_p | The point to test. |
|
noexcept |
Get the center point.
|
noexcept |
Get the dimension of this sphere.
|
noexcept |
Get the inner radius.
|
noexcept |
Get the outer radius.
|
noexcept |
Compute the (hyper)volume or Lebesgue measure.
std::vector< double > NSphericalShell::Sample | ( | ) | const |
Sample a random point in the n-spherical shell with uniform probability via the Muller/Marsaglia method.
|
noexcept |
Set the center point.
_c | The new center point. |
|
noexcept |
Set the inner radius.
|
noexcept |
Set the outer radius.
|
noexcept |
Translate the entire n-spherical shell.
_v | The translation vector to apply. |
|
friend |