stator
A math, geometry, and utility library
Namespaces | Classes | Functions
stator::geometry Namespace Reference

Geometric types and algorithms for calculating properties (e.g., intersection, volume).

Namespaces

 detail
 

Classes

class  AABox
 An axis-aligned box/block (including its interior volume). More...
 
class  Ball
 An n-ball (an n-sphere including its interior volume). More...
 
class  HalfSpace
 A planar half-space (a plane and the volume on one side of the plane). More...
 
class  InverseBall
 An inverse n-ball (an n-sphere including its exterior volume). More...
 
class  Plane
 An infinite flat surface of fixed thickness. More...
 
class  Point
 A point. More...
 

Functions

template<typename Scalar , size_t D>
Scalar area (const Point< Scalar, D > &sphere)
 
template<typename Scalar , size_t D>
Scalar area (const AABox< Scalar, D > &bb)
 Calculate the surface area of an Axis-Aligned Box. More...
 
template<typename Scalar , size_t D>
Scalar area (const Ball< Scalar, D > &sphere)
 Calculate the surface area of a n-ball. More...
 
template<typename Obj >
auto area (const Obj &)
 Compute a Hausdorf measure of the boundary/boundaries of an object. More...
 
template<class Scalar , size_t D, class DeltaRijFunc >
auto indicator (const Ball< Scalar, D > &bi, const Point< Scalar, D > &bj, const DeltaRijFunc &deltarij) -> STATOR_AUTORETURN_BYVALUE(pow< 2 >(try_simplify(deltarij+bi.center() - bj.center())) - pow< 2 >(bi.radius()))
 Ball-Point indicator function. More...
 
template<class Scalar , size_t D, class DeltaRijFunc >
auto indicator (const Point< Scalar, D > &bi, const Ball< Scalar, D > &bj, const DeltaRijFunc &deltarij) -> STATOR_AUTORETURN_BYVALUE(indicator(bj, bi, -deltarij))
 Point-Ball indicator function. More...
 
template<class Scalar , size_t D, class DeltaRijFunc >
auto indicator (const Ball< Scalar, D > &bi, const Ball< Scalar, D > &bj, const DeltaRijFunc &deltarij) -> STATOR_AUTORETURN_BYVALUE(pow< 2 >(try_simplify(deltarij+bi.center() - bj.center())) - pow< 2 >(bi.radius()+bj.radius()))
 Ball-Ball indicator function. More...
 
template<class Scalar , size_t D, class DeltaRijFunc >
auto indicator (const Ball< Scalar, D > &bi, const HalfSpace< Scalar, D > &bj, const DeltaRijFunc &deltarij) -> STATOR_AUTORETURN_BYVALUE(try_simplify(dot(bj.normal(), deltarij+bi.center() - bj.center()) - bi.radius()))
 Ball-HalfSpace indicator function. More...
 
template<class Scalar , size_t D, class DeltaRijFunc >
auto indicator (const HalfSpace< Scalar, D > &bi, const Ball< Scalar, D > &bj, const DeltaRijFunc &deltarij) -> STATOR_AUTORETURN_BYVALUE(indicator(bj, bi, -deltarij))
 HalfSpace-Ball indicator function. More...
 
bool intersects (const Object1 &, const Object2 &)
 Determine if two objects are intersecting. More...
 
template<typename Scalar , size_t D>
Scalar volume (const AABox< Scalar, D > &bb)
 Calculate the volume of an Axis-Aligned Box. More...
 
template<typename Scalar , size_t D>
constexpr Scalar volume (const Point< Scalar, D > &ball)
 
template<typename Scalar , size_t D>
Scalar volume (const Ball< Scalar, D > &ball)
 Calculate the volume of a n-ball. More...
 
template<typename Obj >
auto volume (const Obj &)
 Compute a Hausdorf measure of the interior of an object. More...
 

Function Documentation

◆ area() [1/4]

template<typename Scalar , size_t D>
Scalar stator::geometry::area ( const Point< Scalar, D > &  sphere)

Definition at line 61 of file point.hpp.

◆ area() [2/4]

template<typename Scalar , size_t D>
Scalar stator::geometry::area ( const AABox< Scalar, D > &  bb)

Definition at line 64 of file box.hpp.

◆ area() [3/4]

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

Definition at line 127 of file sphere.hpp.

◆ area() [4/4]

template<typename Obj >
auto stator::geometry::area ( const Obj &  )

The measure returned depends on the dimensionality object. For example, a Sphere will return its surface area whereas a circle will return its perimeter.

◆ indicator() [1/5]

template<class Scalar , size_t D, class DeltaRijFunc >
auto stator::geometry::indicator ( const Ball< Scalar, D > &  bi,
const Point< Scalar, D > &  bj,
const DeltaRijFunc &  deltarij 
) -> STATOR_AUTORETURN_BYVALUE(pow< 2 >(try_simplify(deltarij+bi.center() - bj.center())) - pow< 2 >(bi.radius()))

◆ indicator() [2/5]

template<class Scalar , size_t D, class DeltaRijFunc >
auto stator::geometry::indicator ( const Point< Scalar, D > &  bi,
const Ball< Scalar, D > &  bj,
const DeltaRijFunc &  deltarij 
) -> STATOR_AUTORETURN_BYVALUE(indicator(bj, bi, -deltarij))

◆ indicator() [3/5]

template<class Scalar , size_t D, class DeltaRijFunc >
auto stator::geometry::indicator ( const Ball< Scalar, D > &  bi,
const Ball< Scalar, D > &  bj,
const DeltaRijFunc &  deltarij 
) -> STATOR_AUTORETURN_BYVALUE(pow< 2 >(try_simplify(deltarij+bi.center() - bj.center())) - pow< 2 >(bi.radius()+bj.radius()))

◆ indicator() [4/5]

template<class Scalar , size_t D, class DeltaRijFunc >
auto stator::geometry::indicator ( const Ball< Scalar, D > &  bi,
const HalfSpace< Scalar, D > &  bj,
const DeltaRijFunc &  deltarij 
) -> STATOR_AUTORETURN_BYVALUE(try_simplify(dot(bj.normal(), deltarij+bi.center() - bj.center()) - bi.radius()))

◆ indicator() [5/5]

template<class Scalar , size_t D, class DeltaRijFunc >
auto stator::geometry::indicator ( const HalfSpace< Scalar, D > &  bi,
const Ball< Scalar, D > &  bj,
const DeltaRijFunc &  deltarij 
) -> STATOR_AUTORETURN_BYVALUE(indicator(bj, bi, -deltarij))

◆ intersects()

bool stator::geometry::intersects ( const Object1 &  ,
const Object2 &   
)

◆ volume() [1/4]

template<typename Scalar , size_t D>
Scalar stator::geometry::volume ( const AABox< Scalar, D > &  bb)

Definition at line 54 of file box.hpp.

◆ volume() [2/4]

template<typename Scalar , size_t D>
constexpr Scalar stator::geometry::volume ( const Point< Scalar, D > &  ball)

Definition at line 58 of file point.hpp.

◆ volume() [3/4]

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

Definition at line 121 of file sphere.hpp.

◆ volume() [4/4]

template<typename Obj >
auto stator::geometry::volume ( const Obj &  )

The measure returned depends on the dimensionality of the object, a circle will return its area but a sphere will return its volume