An N-dimensional circle, sphere, or hypersphere with a filled interior.
More...
#include <geomc/shape/Sphere.h>
|
|
using | elem_t |
| | The coordinate type of this object.
|
| using | point_t |
| | The type of a point in this object's space.
|
|
|
static constexpr bool | admits_cusps () |
|
|
point_t | center |
| | Center of the sphere.
|
|
T | radius |
| | Radius of the sphere.
|
|
|
static constexpr index_t | N |
| | The dimension of this object.
|
|
(Note that these are not member symbols.)
|
| template<typename T> |
| using | Circle = Sphere<T,2> |
| | A 2D circle.
|
template<typename T, index_t N>
class geom::Sphere< T, N >
An N-dimensional circle, sphere, or hypersphere with a filled interior.
Circle<T> is a template alias for Sphere<T,2>.
◆ point_t
The type of a point in this object's space.
An N-vector of T if N > 1, otherwise a T.
◆ Sphere() [1/3]
template<typename T, index_t N>
Construct a sphere at the origin with radius 1.
◆ Sphere() [2/3]
template<typename T, index_t N>
Construct a sphere with center at the origin, having radius r.
- Parameters
-
◆ Sphere() [3/3]
template<typename T, index_t N>
Construct a sphere with center at the point c, having radius r.
- Parameters
-
| c | Center of sphere. |
| r | Radius of spehre. |
◆ intersects()
template<typename T, index_t N>
| bool intersects |
( |
Sphere< T, N > | s | ) |
const |
|
inline |
Sphere-sphere intersection test.
- Parameters
-
- Returns
- true if s overlaps with this sphere's volume, false otherwise.
◆ measure_boundary()
template<typename T, index_t N>
| T measure_boundary |
( |
| ) |
const |
|
inline |
Measure the boundary of the shape.
If the sphere is 2D (a circle), this is the circumference of the circle. If the sphere is 3D (a sphere), this is the surface area of the sphere. In higher dimensions, this is the volume or hypervolume of the boundary.
◆ measure_interior()
template<typename T, index_t N>
| T measure_interior |
( |
| ) |
const |
|
inline |
Measure the interior (volume) of the shape.
If the sphere is 2D (a disk), this is the area of the disk. If the sphere is 3D (a ball), this is the volume of the ball. In higher dimensions, this is the hypervolume.
◆ project()
template<typename T, index_t N>
Return the point p orthogonally projected onto the surface of the shape.
The documentation for this class was generated from the following files: