pub struct Cubic { /* private fields */ }Expand description
A cubic polynomial mapping of the unit interval.
The Curves class contains some commonly used cubic curves, such as
Curves::ease, Curves::ease_in, Curves::ease_out and
Curves::ease_in_out.
The Cubic class implements third-order Bézier curves.
See also:
Curves, where many more predefined curves are available.CatmullRomCurve, a curve which passes through specific values.
Implementations§
Source§impl Cubic
impl Cubic
Sourcepub const fn new(a: f64, b: f64, c: f64, d: f64) -> Cubic
pub const fn new(a: f64, b: f64, c: f64, d: f64) -> Cubic
Creates a cubic curve.
Rather than creating a new instance, consider using one of the common
cubic curves in Curves.
Sourcepub const fn a(&self) -> f64
pub const fn a(&self) -> f64
The x coordinate of the first control point.
The line through the point (0, 0) and the first control point is tangent to the curve at the point (0, 0).
Sourcepub const fn b(&self) -> f64
pub const fn b(&self) -> f64
The y coordinate of the first control point.
The line through the point (0, 0) and the first control point is tangent to the curve at the point (0, 0).
Trait Implementations§
Auto Trait Implementations§
impl Forget for Cubic
impl Freeze for Cubic
impl Move for Cubic
impl RefUnwindSafe for Cubic
impl Send for Cubic
impl Sync for Cubic
impl Unpin for Cubic
impl UnsafeUnpin for Cubic
impl UnwindSafe for Cubic
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