Celeritas
0.5.0-86+4a8eea4
|
General quadric surface. More...
#include <GeneralQuadric.hh>
Public Types | |
using | Intersections = Array< real_type, 2 > |
Type aliases. | |
using | StorageSpan = Span< real_type const, 10 > |
using | SpanConstReal3 = Span< real_type const, 3 > |
Public Member Functions | |
GeneralQuadric (Real3 const &abc, Real3 const &def, Real3 const &ghi, real_type j) | |
Construct with all coefficients. More... | |
template<class R > | |
CELER_FUNCTION | GeneralQuadric (Span< R, StorageSpan::extent >) |
Construct from raw data. | |
GeneralQuadric (SimpleQuadric const &other) noexcept(!CELERITAS_DEBUG) | |
Promote from a simple quadric. | |
CELER_FUNCTION SpanConstReal3 | second () const |
Second-order terms. | |
CELER_FUNCTION SpanConstReal3 | cross () const |
Cross terms (xy, yz, zx) | |
CELER_FUNCTION SpanConstReal3 | first () const |
First-order terms. | |
CELER_FUNCTION real_type | zeroth () const |
Zeroth-order term. | |
CELER_FUNCTION StorageSpan | data () const |
Get a view to the data for type-deleted storage. | |
CELER_FUNCTION SignedSense | calc_sense (Real3 const &pos) const |
Determine the sense of the position relative to this surface. | |
CELER_FUNCTION Intersections | calc_intersections (Real3 const &pos, Real3 const &dir, SurfaceState on_surface) const |
Calculate all possible straight-line intersections with this surface. | |
CELER_FUNCTION Real3 | calc_normal (Real3 const &pos) const |
Calculate outward normal at a position. | |
Static Public Member Functions | |
static CELER_CONSTEXPR_FUNCTION SurfaceType | surface_type () |
Surface type identifier. | |
static CELER_CONSTEXPR_FUNCTION bool | simple_safety () |
Safety is not the nearest intersection along the surface "normal". | |
General quadric surface.
General quadrics that cannot be simplified to other ORANGE surfaces include hyperboloids and paraboloids; and non-axis-aligned cylinders, ellipsoids, and cones.
\[ ax^2 + by^2 + cz^2 + dxy + eyz + fzx + gx + hy + iz + j = 0 \]
Note that some formulations of a general quadric include a factor of 2 for the g/h/i terms.
|
explicit |
Construct with all coefficients.
TODO: normalize so that largest eigenvalue is unity? Or what? (It would be nice to have "slightly twisted planes" have order-epsilon cross terms as opposed to order 1/eps linear terms.)