#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
x0number The x coordinate of the second control pointy0number The y coordinate of the second control pointx1number The x coordinate of the third control pointy1number The y coordinate of the third control point
Redefines the instance
Parameters
x1number The x coordinate of the second control pointy1number The y coordinate of the second control pointx2number The x coordinate of the third control pointy2number 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
tnumber 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
tnumber The time
Returns number
Returns the t of x
Parameters
xnumber The x coordinate
Returns number
Returns the t of y
Parameters
ynumber The y coordinate
Returns number
Returns the x of y
Parameters
ynumber The y coordinate
Returns number
Returns the y of x
Parameters
xnumber The x coordinate
Returns number
Returns a string representation of the instance
Parameters
digitsint? The decimal places (optional, default3)
Returns string
Returns a defined instance
Parameters
x1number The x coordinate of the second control pointy1number The y coordinate of the second control pointx2number The x coordinate of the third control pointy2number The y coordinate of the third control pointtargetBezierEase? The target instance
Returns BezierEase
Returns a instance representing the (0.0,0.0,1.0,1.0) bezier curve
Parameters
targetBezierEase? The target instance
Returns BezierEase
Returns a instance representing the (0.25,0.1,0.25,1.0) bezier curve
Parameters
targetBezierEase? The target instance
Returns BezierEase
Returns a instance representing the (0.42,0.0,1.0,1.0) bezier curve
Parameters
targetBezierEase? The target instance
Returns BezierEase
Returns a instance representing the (0.0,0.0,0.58,1.0) bezier curve
Parameters
targetBezierEase? The target instance
Returns BezierEase
Returns a instance representing the (0.42,0.0,0.58,1.0) bezier curve
Parameters
targetBezierEase? The target instance
Returns BezierEase
Returns true if a == b, false otherwise
Parameters
aBezierEase The protagonistbBezierEase The antagonist
Returns boolean
Transformation interval
Creates a new instance
Parameters
t0number The first interval offsettDeltanumber The interval durationn0number The first interval statenDeltanumber The interval magnitudeeaseBezierEase The interval easing
The first interval state
The interval duration
The first interval state
The interval magnitude
The interval easing
Redefines the instance
Parameters
t0number The first interval offsettDeltanumber The interval durationn0number The first interval statenDeltanumber The interval magnitudeeaseBezierEase The interval easing
Returns Interval
The last interval offset
The last interval state
Returns the unclamped interval duration fraction
Parameters
tnumber The time
Returns number
Returns the clamped interval state
Parameters
tnumber The time
Returns number
Returns the unclamped interval state
Parameters
fnumber The interval duration fraction
Returns number
Returns a string representation of the instance
Parameters
digitsint? The representation digits (optional, default3)
Returns string
Returns a defined instance
Parameters
t0number The first interval offsettDeltanumber The interval durationn0number The first interval statenDeltanumber The interval magnitudeeaseBezierEase? The interval easingtargetInterval? The target instance
Returns Interval
Returns an instance from interval extremes
Parameters
t0number The first interval offsettNnumber The last interval offsetn0number The first interval statenNnumber The last interval stateeaseBezierEase? The interval easingtargetInterval? The target instance
Returns Interval