pub struct Hyperbola3D { /* private fields */ }Expand description
A 3D hyperbola defined by center, axis, and two semi-axis lengths.
Parameterized as P(t) = center + a * cosh(t) * u_axis + b * sinh(t) * v_axis.
The parameter t ranges over all reals; t = 0 gives the vertex
closest to center on the positive branch.
Implementations§
Source§impl Hyperbola3D
impl Hyperbola3D
Sourcepub fn new(
center: Point3,
normal: Vec3,
semi_major: f64,
semi_minor: f64,
) -> Result<Self, MathError>
pub fn new( center: Point3, normal: Vec3, semi_major: f64, semi_minor: f64, ) -> Result<Self, MathError>
Creates a new hyperbola.
semi_major is the real semi-axis (distance from center to vertex),
semi_minor is the imaginary semi-axis.
§Errors
Returns an error if either semi-axis is non-positive.
Sourcepub const fn semi_major(&self) -> f64
pub const fn semi_major(&self) -> f64
Returns the semi-major axis (real axis).
Sourcepub const fn semi_minor(&self) -> f64
pub const fn semi_minor(&self) -> f64
Returns the semi-minor axis (imaginary axis).
Sourcepub const fn normal(&self) -> Vec3
pub const fn normal(&self) -> Vec3
Returns the normal (axis perpendicular to the hyperbola plane).
Sourcepub const fn u_axis(&self) -> Vec3
pub const fn u_axis(&self) -> Vec3
Returns the in-plane u-axis (real semi-axis direction).
At parameter t, the hyperbola is at offset
semi_major * cosh(t) * u_axis + semi_minor * sinh(t) * v_axis
from the center.
Sourcepub const fn v_axis(&self) -> Vec3
pub const fn v_axis(&self) -> Vec3
Returns the in-plane v-axis (imaginary semi-axis direction).
Sourcepub fn eccentricity(&self) -> f64
pub fn eccentricity(&self) -> f64
Returns the eccentricity: e = sqrt(1 + (b/a)²).
Trait Implementations§
Source§impl Clone for Hyperbola3D
impl Clone for Hyperbola3D
Source§fn clone(&self) -> Hyperbola3D
fn clone(&self) -> Hyperbola3D
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more