pub struct Parabola3D { /* private fields */ }Expand description
A 3D parabola defined by vertex, axis direction, and focal length.
Parameterized as P(t) = vertex + (t²/(4f)) * axis_dir + t * u_axis
where f is the focal length and u_axis is perpendicular to the axis
in the parabola plane.
The parameter t ranges over all reals; t = 0 is the vertex.
Implementations§
Source§impl Parabola3D
impl Parabola3D
Sourcepub fn new(
vertex: Point3,
axis_dir: Vec3,
focal_length: f64,
) -> Result<Self, MathError>
pub fn new( vertex: Point3, axis_dir: Vec3, focal_length: f64, ) -> Result<Self, MathError>
Creates a new parabola.
axis_dir is the direction from vertex toward the interior of the
parabola (the axis of symmetry). focal_length is the distance
from vertex to focus.
§Errors
Returns an error if focal_length is not positive or axis_dir is zero.
Sourcepub fn evaluate(&self, t: f64) -> Point3
pub fn evaluate(&self, t: f64) -> Point3
Evaluates the parabola at parameter t.
At t = 0 this returns the vertex.
Sourcepub const fn focal_length(&self) -> f64
pub const fn focal_length(&self) -> f64
Returns the focal length.
Trait Implementations§
Source§impl Clone for Parabola3D
impl Clone for Parabola3D
Source§fn clone(&self) -> Parabola3D
fn clone(&self) -> Parabola3D
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Parabola3D
impl RefUnwindSafe for Parabola3D
impl Send for Parabola3D
impl Sync for Parabola3D
impl Unpin for Parabola3D
impl UnsafeUnpin for Parabola3D
impl UnwindSafe for Parabola3D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more