pub struct ThreePointCubic { /* private fields */ }Expand description
A cubic polynomial composed of two curves that share a common center point.
The curve runs through three points: (0,0), the
midpoint, and (1,1).
The Curves class contains a curve defined with this class:
Curves::ease_in_out_cubic_emphasized.
The ThreePointCubic class implements third-order Bézier curves, where two
curves share an interior midpoint that the
curve passes through. If the control points surrounding the middle point
(b1, and a2) are not
collinear with the middle point, then the curve’s derivative will have a
discontinuity (a cusp) at the shared middle point.
See also:
Implementations§
Source§impl ThreePointCubic
impl ThreePointCubic
Sourcepub const fn new(
a1: Offset,
b1: Offset,
midpoint: Offset,
a2: Offset,
b2: Offset,
) -> ThreePointCubic
pub const fn new( a1: Offset, b1: Offset, midpoint: Offset, a2: Offset, b2: Offset, ) -> ThreePointCubic
Creates two cubic curves that share a common control point.
Rather than creating a new instance, consider using one of the common
three-point cubic curves in Curves.
The arguments correspond to the control points for the two curves,
including the midpoint, but do not include
the two implied end points at (0,0) and (1,1), which are fixed.
Sourcepub const fn a1(&self) -> Offset
pub const fn a1(&self) -> Offset
The coordinates of the first control point of the first curve.
The line through the point (0, 0) and this control point is tangent to the curve at the point (0, 0).