|
Celeritas 0.7-develop+db9a1d4
|
Sphere centered at an arbitrary point. More...
#include <Sphere.hh>
Public Types | |
| using | Intersections = Array< real_type, 2 > |
| Type aliases. | |
| using | StorageSpan = Span< real_type const, 4 > |
| using | Gradient = detail::ScaledReal3< detail::Quadratic > |
Public Member Functions | |
| Sphere (Real3 const &origin, real_type radius) | |
| Construct with sphere origin and radius. | |
| template<class R > | |
| Sphere (Span< R, StorageSpan::extent >) | |
| Construct from raw data. | |
| Sphere (SphereCentered const &other) noexcept | |
| Promote from a centered sphere. | |
| Real3 const & | origin () const |
| Center position. | |
| real_type | radius_sq () const |
| Square of the radius. | |
| StorageSpan | data () const |
| Get a view to the data for type-deleted storage. | |
| SignedSense | calc_sense (Real3 const &pos) const |
| Determine the sense of the position relative to this surface. | |
| real_type | calc_value (Real3 const &pos) const |
| Evaluate the sphere expression at a point. | |
| Intersections | calc_intersections (Real3 const &pos, Real3 const &dir, SurfaceState on_surface) const |
| Calculate all possible straight-line intersections with this surface. | |
| Real3 | calc_normal (Real3 const &pos) const |
| Calculate outward normal at a position. | |
| Gradient | calc_gradient (Real3 const &pos) const |
| Calculate the gradient at a point. | |
| real_type | calc_safety (Real3 const &pos) const |
| Calculate the distance to the nearest point on the surface. | |
Static Public Member Functions | |
| static constexpr SurfaceType | surface_type () |
| Surface type identifier. | |
| static constexpr bool | simple_safety () |
| Safety is intersection along surface normal. | |
| static Sphere | from_radius_sq (Real3 const &origin, real_type rsq) |
| Construct from the square of the radius. | |
Sphere centered at an arbitrary point.
\[ (x - x_0)^2 + (y - y_0)^2 + (z - z_0)^2 - r^2 = 0 \]
Calculate the distance to the nearest point on the surface.
This is the magnitude of the radial displacement from the surface: \( | |\mathbf{x} - \mathbf{x}_0| - R | \).
Construct from the square of the radius.
This is used for surface simplification.