Skip to main content

Cubic

Struct Cubic 

Source
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

Source

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.

Source

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).

Source

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).

Source

pub const fn c(&self) -> f64

The x coordinate of the second control point.

The line through the point (1, 1) and the second control point is tangent to the curve at the point (1, 1).

Source

pub const fn d(&self) -> f64

The y coordinate of the second control point.

The line through the point (1, 1) and the second control point is tangent to the curve at the point (1, 1).

Trait Implementations§

Source§

impl Curve for Cubic

Source§

fn transform_internal(&self, t: f64) -> f64

Returns the value of the curve at point t. Read more
Source§

fn transform(&self, t: f64) -> f64

Returns the value of the curve at point t. Read more
Source§

impl Debug for Cubic

Source§

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

Formats the value using the given formatter. Read more

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> 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,