Skip to main content

Hyperbola3D

Struct Hyperbola3D 

Source
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

Source

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.

Source

pub fn evaluate(&self, t: f64) -> Point3

Evaluates the hyperbola at parameter t.

Source

pub fn tangent(&self, t: f64) -> Vec3

Returns the tangent vector at parameter t.

Source

pub const fn center(&self) -> Point3

Returns the center.

Source

pub const fn semi_major(&self) -> f64

Returns the semi-major axis (real axis).

Source

pub const fn semi_minor(&self) -> f64

Returns the semi-minor axis (imaginary axis).

Source

pub const fn normal(&self) -> Vec3

Returns the normal (axis perpendicular to the hyperbola plane).

Source

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.

Source

pub const fn v_axis(&self) -> Vec3

Returns the in-plane v-axis (imaginary semi-axis direction).

Source

pub fn eccentricity(&self) -> f64

Returns the eccentricity: e = sqrt(1 + (b/a)²).

Source

pub fn foci(&self) -> (Point3, Point3)

Returns the two foci.

Trait Implementations§

Source§

impl Clone for Hyperbola3D

Source§

fn clone(&self) -> Hyperbola3D

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Hyperbola3D

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.