#bease
##Install
$ npm install bease
##Use
import Ease from 'ease/source/BezierEase';
import Interval from 'ease/source/Interval';
const ease = Ease.EaseIn();
const y = ease.yOfX(0.5);
const interval = new Interval(0.0, 60.0, 0.0, 100.0, ease);
const n = interval.nOfT(30.0);
Bezier easing curve
Creates a new instance
Parameters
x0
number The x coordinate of the second control pointy0
number The y coordinate of the second control pointx1
number The x coordinate of the third control pointy1
number The y coordinate of the third control point
Redefines the instance
Parameters
x1
number The x coordinate of the second control pointy1
number The y coordinate of the second control pointx2
number The x coordinate of the third control pointy2
number The y coordinate of the third control point
Returns BezierEase
The x coordinate of the second control point
The y coordinate of the second control point
The x coordinate of the third control point
The y coordinate of the third control point
Returns the x of t p(t) = (1-t)³p0 + 3t(1-t)²p1 + 3t²(1-t)p2 + t³p3 => 3t(1-t)²p1 + 3t²(1-t)p2 + t³ <=> (1-3p2+3p1)t³ + (3p2-6p1)t² + (3p1)t => at³ + bt² + ct
Parameters
t
number The time
Returns number
Returns the y of t p(t) = (1-t)³p0 + 3t(1-t)²p1 + 3t²(1-t)p2 + t³p3 => 3t(1-t)²p1 + 3t²(1-t)p2 + t³ <=> (1-3p2+3p1)t³ + (3p2-6p1)t² + (3p1)t => at³ + bt² + ct
Parameters
t
number The time
Returns number
Returns the t of x
Parameters
x
number The x coordinate
Returns number
Returns the t of y
Parameters
y
number The y coordinate
Returns number
Returns the x of y
Parameters
y
number The y coordinate
Returns number
Returns the y of x
Parameters
x
number The x coordinate
Returns number
Returns a string representation of the instance
Parameters
digits
int? The decimal places (optional, default3
)
Returns string
Returns a defined instance
Parameters
x1
number The x coordinate of the second control pointy1
number The y coordinate of the second control pointx2
number The x coordinate of the third control pointy2
number The y coordinate of the third control pointtarget
BezierEase? The target instance
Returns BezierEase
Returns a instance representing the (0.0,0.0,1.0,1.0) bezier curve
Parameters
target
BezierEase? The target instance
Returns BezierEase
Returns a instance representing the (0.25,0.1,0.25,1.0) bezier curve
Parameters
target
BezierEase? The target instance
Returns BezierEase
Returns a instance representing the (0.42,0.0,1.0,1.0) bezier curve
Parameters
target
BezierEase? The target instance
Returns BezierEase
Returns a instance representing the (0.0,0.0,0.58,1.0) bezier curve
Parameters
target
BezierEase? The target instance
Returns BezierEase
Returns a instance representing the (0.42,0.0,0.58,1.0) bezier curve
Parameters
target
BezierEase? The target instance
Returns BezierEase
Returns true if a == b, false otherwise
Parameters
a
BezierEase The protagonistb
BezierEase The antagonist
Returns boolean
Transformation interval
Creates a new instance
Parameters
t0
number The first interval offsettDelta
number The interval durationn0
number The first interval statenDelta
number The interval magnitudeease
BezierEase The interval easing
The first interval state
The interval duration
The first interval state
The interval magnitude
The interval easing
Redefines the instance
Parameters
t0
number The first interval offsettDelta
number The interval durationn0
number The first interval statenDelta
number The interval magnitudeease
BezierEase The interval easing
Returns Interval
The last interval offset
The last interval state
Returns the unclamped interval duration fraction
Parameters
t
number The time
Returns number
Returns the clamped interval state
Parameters
t
number The time
Returns number
Returns the unclamped interval state
Parameters
f
number The interval duration fraction
Returns number
Returns a string representation of the instance
Parameters
digits
int? The representation digits (optional, default3
)
Returns string
Returns a defined instance
Parameters
t0
number The first interval offsettDelta
number The interval durationn0
number The first interval statenDelta
number The interval magnitudeease
BezierEase? The interval easingtarget
Interval? The target instance
Returns Interval
Returns an instance from interval extremes
Parameters
t0
number The first interval offsettN
number The last interval offsetn0
number The first interval statenN
number The last interval stateease
BezierEase? The interval easingtarget
Interval? The target instance
Returns Interval