Parasol Planning Library (PPL)
Friends
NSphericalShell Class Reference

#include <NSphericalShell.h>

Inheritance diagram for NSphericalShell:
Inheritance graph
[legend]

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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ NSphericalShell() [1/2]

NSphericalShell::NSphericalShell ( const size_t  _n,
const double  _outer = std::numeric_limits<double>::max(),
const double  _inner = 0 
)
explicit

Construct an n-spherical shell at the origin with a given dimension and radius.

Parameters
_nThe dimension.
_outerThe outer radius (infinite by default).
_innerThe inner radius (0 by default).

◆ NSphericalShell() [2/2]

NSphericalShell::NSphericalShell ( const std::vector< double > &  _center,
const double  _outer = std::numeric_limits<double>::max(),
const double  _inner = 0 
)
explicit

Construct an n-spherical shell with a given center point and radius.

Parameters
_cThe center point, which is assumed to be of full dimension.
_outerThe outer radius (infinite by default).
_innerThe inner radius (0 by default).

◆ ~NSphericalShell()

NSphericalShell::~NSphericalShell ( )
virtualdefaultnoexcept

Member Function Documentation

◆ Clearance()

double NSphericalShell::Clearance ( std::vector< double >  _p) const
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.

Parameters
_pThe point of interest.
Returns
The minimum distance from _p to the sphere's surface.

◆ ClearancePoint()

std::vector< double > NSphericalShell::ClearancePoint ( std::vector< double >  _p) const
noexcept

Find the point on the sphere that is nearest to a given reference point.

Parameters
_pThe reference point.
Returns
The point on the surface that is nearest to _p.

◆ Contains()

bool NSphericalShell::Contains ( const std::vector< double > &  _p) const
noexcept

Test if a given point lies within the n-spherical shell.

Parameters
_pThe point to test.
Returns
True if _p lies within the n-spherical shell.

◆ GetCenter()

const std::vector< double > & NSphericalShell::GetCenter ( ) const
noexcept

Get the center point.

◆ GetDimension()

size_t NSphericalShell::GetDimension ( ) const
noexcept

Get the dimension of this sphere.

◆ GetInnerRadius()

double NSphericalShell::GetInnerRadius ( ) const
noexcept

Get the inner radius.

◆ GetOuterRadius()

double NSphericalShell::GetOuterRadius ( ) const
noexcept

Get the outer radius.

◆ GetVolume()

double NSphericalShell::GetVolume ( ) const
noexcept

Compute the (hyper)volume or Lebesgue measure.

◆ Sample()

std::vector< double > NSphericalShell::Sample ( ) const

Sample a random point in the n-spherical shell with uniform probability via the Muller/Marsaglia method.

Todo:
This is likely close but not correct, need to verify.

◆ SetCenter()

void NSphericalShell::SetCenter ( const std::vector< double > &  _c)
noexcept

Set the center point.

Parameters
_cThe new center point.

◆ SetInnerRadius()

void NSphericalShell::SetInnerRadius ( const double  _r)
noexcept

Set the inner radius.

◆ SetOuterRadius()

void NSphericalShell::SetOuterRadius ( const double  _r)
noexcept

Set the outer radius.

◆ Translate()

void NSphericalShell::Translate ( const std::vector< double > &  _v)
noexcept

Translate the entire n-spherical shell.

Parameters
_vThe translation vector to apply.

Friends And Related Function Documentation

◆ operator>>

std::istream& operator>> ( std::istream &  _is,
NSphericalShell _sphere 
)
friend

The documentation for this class was generated from the following files: