Defines an oriented Sphere in 2-D (i.e., a circle) or 3-D given by its center, \( \mathcal{X} \) and radius \( \mathcal{R} \). The Sphere object provides associated operations on a sphere, such as, signed distance and orientation.
More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/primal/geometry/Sphere.hpp>
template<typename T, int NDIMS>
class axom::primal::Sphere< T, NDIMS >
Defines an oriented Sphere in 2-D (i.e., a circle) or 3-D given by its center, \( \mathcal{X} \) and radius \( \mathcal{R} \). The Sphere object provides associated operations on a sphere, such as, signed distance and orientation.
- Template Parameters
-
T | the coordinate type, e.g., double, float, etc. |
NDIMS | the number of dimensions |
◆ PointType
template<typename T , int NDIMS>
◆ Sphere() [1/3]
template<typename T , int NDIMS>
Constructs a Sphere centered at origin with the given radius.
- Parameters
-
[in] | radius | the radius of the Sphere (optional). |
- Note
- If a radius is not supplied, the default radius is 1.0.
◆ Sphere() [2/3]
template<typename T , int NDIMS>
Constructs a Sphere with the given center and radius.
- Parameters
-
[in] | center | user-supplied center. |
[in] | radius | the radius of the Sphere (optional). |
- Note
- If a radius is not supplied, the default radius is 1.0.
◆ Sphere() [3/3]
template<typename T , int NDIMS>
Constructs a Sphere with the given center and radius.
- Parameters
-
[in] | center | user-supplied center. |
[in] | radius | the radius of the Sphere (optional). |
- Note
- If a radius is not supplied, the default radius is 1.0.
- Precondition
- center != nullptr
References SLIC_ASSERT.
◆ getRadius()
template<typename T , int NDIMS>
Returns the radius of the Sphere.
- Returns
- r the radius of the Sphere.
◆ getCenter()
template<typename T , int NDIMS>
Returns the center of the Sphere.
- Returns
- c pointer to array that holds the center of the Sphere.
- Note
- c points to an array that is NDIMS long.
- Postcondition
- c != nullptr
◆ computeSignedDistance()
template<typename T , int NDIMS>
Computes the signed distance of a point to the Sphere's boundary.
- Parameters
-
- Returns
- d the computed signed distance of the point q to the sphere.
- Note
- The signed distance of a point q is:
-
negative inside the sphere
-
positive outside the sphere
-
zero on the boundary
References axom::primal::Vector< T, NDIMS >::norm().
◆ getOrientation()
template<typename T , int NDIMS>
◆ intersectsWith()
template<typename T , int NDIMS>
◆ print()
template<typename T , int NDIMS>
Prints the Sphere information in the given output stream.
- Parameters
-
[in,out] | os | the output stream to write to. |
- Note
- This method is primarily used for debugging.
- Returns
- s the modified output stream object.
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/primal/geometry/Sphere.hpp