Struct ball_t

Struct Documentation

struct ball_t

A ball: the interior of a spherical shell.

Public Functions

inline constexpr bool empty() const noexcept
inline constexpr bool isfinite() const noexcept
inline constexpr bool overlaps(const ball_t &o) const noexcept
inline constexpr bool contains(const pqvec3_t &p) const noexcept

Checks if the ball contains a point.

inline constexpr bool contains(const ball_t &ball) const noexcept

Checks if the ball contains another ball.

template<std::size_t W>
inline auto contains(const pqvec3_w_t<W> &p) const noexcept

Checks if the ball contains a point. Wide test.

inline constexpr auto volume() const noexcept

Ball volume.

inline constexpr auto surface_area() const noexcept

Surface area of the ball’s spherical shell.

inline constexpr auto grow(const length_t r) const noexcept

Constructs a ball with radius increased (or decreased) by r. Clamps radius to zero.

Public Members

pqvec3_t centre
length_t radius

Public Static Functions

static inline constexpr ball_t from_points(const std::convertible_to<pqvec3_t> auto&... pts)

Constructs the minimal ball that just contains the input list of points (that is, at least one point will lie on the shell of the ball).