stator
A math, geometry, and utility library
Public Member Functions | Protected Attributes | List of all members
stator::geometry::Ball< Scalar, D > Class Template Reference

An n-ball (an n-sphere including its interior volume). More...

#include <sphere.hpp>

Inheritance diagram for stator::geometry::Ball< Scalar, D >:
stator::geometry::InverseBall< Scalar, D >

Public Member Functions

 Ball ()
 Default constructor. More...
 
 Ball (const Scalar &radius, const Vector< Scalar, D > &center=Vector< Scalar, D >::Zero().eval())
 RAII constructor. More...
 
const Vector< Scalar, D > & center () const
 Get function for the ball center. More...
 
const Scalar & radius () const
 Get function for the ball radius. More...
 

Protected Attributes

Vector< Scalar, D > center_
 Center of the ball. More...
 
Scalar radius_
 Radius of the ball. More...
 

Detailed Description

template<typename Scalar, size_t D>
class stator::geometry::Ball< Scalar, D >

In three dimensions, a ball represents the volume of the interior of a sphere, but this class is generalised to other dimensions (e.g. a disc/filled-circle in 2D).

Template Parameters
ScalarThe scalar type used for computation of properties of the object.
DThe dimensionality of the ball.

Definition at line 40 of file sphere.hpp.

Constructor & Destructor Documentation

◆ Ball() [1/2]

template<typename Scalar, size_t D>
stator::geometry::Ball< Scalar, D >::Ball ( )
inline

This constructor deliberately leaves the object uninitialised to allow convenient stack-based construction without comprimising the detection of uninitialised accesses by tools such as valgrind.

Definition at line 49 of file sphere.hpp.

◆ Ball() [2/2]

template<typename Scalar, size_t D>
stator::geometry::Ball< Scalar, D >::Ball ( const Scalar &  radius,
const Vector< Scalar, D > &  center = Vector<Scalar, D>::Zero().eval() 
)
inline

Definition at line 52 of file sphere.hpp.

Member Function Documentation

◆ center()

template<typename Scalar, size_t D>
const Vector<Scalar, D>& stator::geometry::Ball< Scalar, D >::center ( ) const
inline

Definition at line 58 of file sphere.hpp.

◆ radius()

template<typename Scalar, size_t D>
const Scalar& stator::geometry::Ball< Scalar, D >::radius ( ) const
inline

Definition at line 55 of file sphere.hpp.

Member Data Documentation

◆ center_

template<typename Scalar, size_t D>
Vector<Scalar, D> stator::geometry::Ball< Scalar, D >::center_
protected

Definition at line 65 of file sphere.hpp.

◆ radius_

template<typename Scalar, size_t D>
Scalar stator::geometry::Ball< Scalar, D >::radius_
protected

Definition at line 62 of file sphere.hpp.


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