Class elliptic_cone_t¶
Defined in File elliptic_cone.hpp
Class Documentation¶
-
class elliptic_cone_t¶
Quantifies the geometry of an elliptical cone. Supports the degenerate cases, where the cone degenerates into an (infinite) cylinder or a ray.
Public Functions
-
inline explicit elliptic_cone_t(const ray_t &r, f_t tan_alpha, length_t initial_x = 0 * u::m)¶
Construct a new elliptic cone object.
- Parameters:
r – central ray
tan_alpha – tan of half opening angle
initial_x – initial major axis length
-
inline explicit elliptic_cone_t(const ray_t &r, const dir3_t &x, f_t tan_alpha, f_t eccentricity, length_t initial_x = 0 * u::m)¶
Construct a new elliptic cone object.
- Parameters:
r – central ray
x – direction of major axis (must be tangent to central ray direction)
tan_alpha – tan of half opening angle
eccentricity – ∈[0,1) elliptical cone eccentricity (0 - isotropic, 1 - degenerate flat cone)
initial_x – initial major axis length
-
elliptic_cone_t(const elliptic_cone_t&) = default¶
-
elliptic_cone_t &operator=(const elliptic_cone_t&) = default¶
-
inline bool degenerate() const noexcept¶
Returns true if the elliptic cone is degenerate: eccentricity=1.
-
inline bool is_ray() const noexcept¶
Returns true if the elliptic cone is a ray: \( \alpha=0 \land x0==0 \).
-
inline bool is_elliptical_frustum() const noexcept¶
Returns true if the elliptic cone is an elliptical frustum.
-
inline const auto &ray() const noexcept¶
Centre ray.
-
inline const auto &o() const noexcept¶
Origin.
-
inline const auto &d() const noexcept¶
Mean direction of propagation (local z axis).
-
inline const auto &x() const noexcept¶
Tangent direction (local x axis).
-
inline const auto y() const noexcept¶
Bi-tangent direction (local y axis).
-
inline constexpr auto x0() const¶
The initial major axis length (in tangent direction) at origin.
-
inline constexpr auto get_tan_alpha() const¶
Tan of half opening angle.
-
inline constexpr auto get_e() const¶
\( \frac{1}{\sqrt{1-\epsilon^2}} \equiv \frac{\textrm{major}}{\textrm{minor}} \), where \( \epsilon \) is eccentricity. Can be \( +\infty \).
-
inline constexpr auto get_one_over_e() const¶
\( \sqrt{1-\epsilon^2} \equiv \frac{\textrm{minor}}{\textrm{major}} \), where \( \epsilon \) is eccentricity.
-
inline constexpr auto get_z_apex() const¶
Precomputed z position of apex point, can be \( -\infty \).
-
inline bool contains(const pqvec3_t &p, const pqrange_t<> &range = {0 * u::m, +m::inf * u::m}) const noexcept¶
Returns true if the elliptic cone contains the point.
- Parameters:
range – restrict z distance to this range
-
inline bool contains_local(const pqvec3_t &p, const pqrange_t<> &range = {0 * u::m, +m::inf * u::m}) const noexcept¶
Returns true if the elliptic cone contains the point (local coordinates)
- Parameters:
range – restrict z distance to this range
-
template<std::size_t W>
inline auto contains_local(const pqvec3_w_t<W> &p, const pqrange_t<> &range) const noexcept¶ Wide contains_local(). Input assumed to be in metres.
- Parameters:
range – restrict z distance to this range
-
template<std::size_t W>
inline auto contains_local(const pqvec3_w_t<W> &p) const noexcept¶ Wide contains_local(). Input assumed to be in metres.
-
inline pqvec2_t project_local(const pqvec3_t &p, const length_t z) const noexcept¶
Returns the point p after projection onto the elliptic cone cross section after propagation of a distance of z. The point ‘p’ is given in local frame.
-
inline pqvec2_t project(const pqvec3_t &p, const length_t z) const noexcept¶
Returns the point p after projection onto the elliptic cone cross section after propagation of a distance of z.
-
inline length_t radius(const length_t z, const dir2_t &r) const noexcept¶
Returns the radius in local direction of the elliptic cone cross-section after propagation a distance of z. (r=(1,0) and r=(0,1) return the lengths of major and minor axes, respectively)
- Parameters:
z – distance of propagation
r – direction on cross section
- Returns:
radius
Public Static Functions
-
static elliptic_cone_t cone_through_ellipse(const pqvec3_t &x, const pqvec3_t &y, const dir3_t &n, const ray_t &ray, const f_t tan_alpha, length_t *self_intersection_distance = nullptr) noexcept¶
Computes an elliptical cone with a fixed propagation direction that passes through an ellipse centred in the origin.
- Parameters:
x – ellipse major axis (direction and length)
y – ellipse minor axis (direction and length, assumed to be orthogonal to x)
n – normal of ellipse
ray – desired cone central ray
tan_alpha – desired tan of cone alpha
self_intersection_distance – (out) the distance past the origin over which the cone continues to intersect the ellipse
- Returns:
cone in the ellipse local frame
-
static inline elliptic_cone_t cone_through_ellipse(const intersection_surface_t &surface, const ray_t &ray, const f_t tan_alpha, length_t *self_intersection_distance = nullptr) noexcept¶
Computes an elliptical cone with a fixed propagation direction that passes through an ellipse centred in the origin.
- Parameters:
surface – surface intersection record
ray – desired cone central ray
tan_alpha – desired tan of cone alpha
self_intersection_distance – (out) the distance past the origin over which the cone continues to intersect the ellipse
- Returns:
cone in the ellipse local frame
-
static elliptic_cone_t cone_through_ellipsoid(const pqvec3_t &axes, const frame_t &axes_frame, const ray_t &ray, const f_t tan_alpha) noexcept¶
Computes an elliptical cone with a fixed propagation direction that passes through an ellipsoid centred in the origin.
- Parameters:
axes – ellipsoid axes lengths
axes_frame – ellipsoid axes world frame
ray – desired cone central ray
tan_alpha – desired tan of cone alpha
- Returns:
cone in the ellipsoids local frame
-
inline explicit elliptic_cone_t(const ray_t &r, f_t tan_alpha, length_t initial_x = 0 * u::m)¶