bease · version 0.1.2

/source/BezierEase.js:BezierEase146-421

Bezier easing curve

Import

import { BezierEase } from 'bease/source/BezierEase.js'

.Define(x1, y1, x2, y2, target)157-162

Returns a defined instance

Signature

{BezierEase} BezierEase.Define({number} x1, {number} y1, {number} x2, {number} y2 [, {BezierEase} target])

Arguments

{number} x1

The x coordinate of the second control point

{number} y1

The y coordinate of the second control point

{number} x2

The x coordinate of the third control point

{number} y2

The y coordinate of the third control point

{BezierEase} target optional

The target instance

Returns

{BezierEase}

.Linear(target)169-171

Returns a instance representing the (0.0,0.0,1.0,1.0) bezier curve

Signature

{BezierEase} BezierEase.Linear([{BezierEase} target])

Arguments

{BezierEase} target optional

The target instance

Returns

{BezierEase}

.Ease(target)178-180

Returns a instance representing the (0.25,0.1,0.25,1.0) bezier curve

Signature

{BezierEase} BezierEase.Ease([{BezierEase} target])

Arguments

{BezierEase} target optional

The target instance

Returns

{BezierEase}

.EaseIn(target)187-189

Returns a instance representing the (0.42,0.0,1.0,1.0) bezier curve

Signature

{BezierEase} BezierEase.EaseIn([{BezierEase} target])

Arguments

{BezierEase} target optional

The target instance

Returns

{BezierEase}

.EaseOut(target)196-198

Returns a instance representing the (0.0,0.0,0.58,1.0) bezier curve

Signature

{BezierEase} BezierEase.EaseOut([{BezierEase} target])

Arguments

{BezierEase} target optional

The target instance

Returns

{BezierEase}

.EaseInOut(target)205-207

Returns a instance representing the (0.42,0.0,0.58,1.0) bezier curve

Signature

{BezierEase} BezierEase.EaseInOut([{BezierEase} target])

Arguments

{BezierEase} target optional

The target instance

Returns

{BezierEase}

.isEQ(a, b)216-223

Returns true if a == b, false otherwise

Signature

{boolean} BezierEase.isEQ({BezierEase} a, {BezierEase} b)

Arguments

{BezierEase} a

The protagonist

{BezierEase} b

The antagonist

Returns

{boolean}

#constructor(x0, y0, x1, y1)234-242

Creates a new instance

Signature

{undefined} BezierEase#constructor({number} x0, {number} y0, {number} x1, {number} y1)

Arguments

{number} x0

The x coordinate of the second control point

{number} y0

The y coordinate of the second control point

{number} x1

The x coordinate of the third control point

{number} y1

The y coordinate of the third control point

Returns

No return value

#define(x1, y1, x2, y2)253-257

Redefines the instance

Signature

{BezierEase} BezierEase#define({number} x1, {number} y1, {number} x2, {number} y2)

Arguments

{number} x1

The x coordinate of the second control point

{number} y1

The y coordinate of the second control point

{number} x2

The x coordinate of the third control point

{number} y2

The y coordinate of the third control point

Returns

{BezierEase}

#x1264-266

The x coordinate of the second control point

Signature

{number} BezierEase#x1

#y1284-286

The y coordinate of the second control point

Signature

{number} BezierEase#y1

#x2304-306

The x coordinate of the third control point

Signature

{number} BezierEase#x2

#y2324-326

The y coordinate of the third control point

Signature

{number} BezierEase#y2

#xOfT(t)348-354

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

Signature

{number} BezierEase#xOfT({number} t)

Arguments

{number} t

The time

Returns

{number}

#yOfT(t)364-370

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

Signature

{number} BezierEase#yOfT({number} t)

Arguments

{number} t

The time

Returns

{number}

#tOfX(x)378-380

Returns the t of x

Signature

{number} BezierEase#tOfX({number} x)

Arguments

{number} x

The x coordinate

Returns

{number}

#tOfY(y)387-389

Returns the t of y

Signature

{number} BezierEase#tOfY({number} y)

Arguments

{number} y

The y coordinate

Returns

{number}

#xOfY(y)397-399

Returns the x of y

Signature

{number} BezierEase#xOfY({number} y)

Arguments

{number} y

The y coordinate

Returns

{number}

#yOfX(x)406-408

Returns the y of x

Signature

{number} BezierEase#yOfX({number} x)

Arguments

{number} x

The x coordinate

Returns

{number}

#toString(digits)416-420

Returns a string representation of the instance

Signature

{string} BezierEase#toString([{int} digits=3])

Arguments

{int} digits optionaldefault3

The decimal places

Returns

{string}

/source/Interval.js:Interval8-169

Transformation interval

Import

import { Interval } from 'bease/source/Interval.js'

.Define(t0, tDelta, n0, nDelta, ease, target)20-25

Returns a defined instance

Signature

{Interval} Interval.Define({number} t0, {number} tDelta, {number} n0, {number} nDelta [, {BezierEase} ease [, {Interval} target]])

Arguments

{number} t0

The first interval offset

{number} tDelta

The interval duration

{number} n0

The first interval state

{number} nDelta

The interval magnitude

{BezierEase} ease optional

The interval easing

{Interval} target optional

The target instance

Returns

{Interval}

.Extremes(t0, tN, n0, nN, ease, target)37-39

Returns an instance from interval extremes

Signature

{Interval} Interval.Extremes({number} t0, {number} tN, {number} n0, {number} nN [, {BezierEase} ease [, {Interval} target]])

Arguments

{number} t0

The first interval offset

{number} tN

The last interval offset

{number} n0

The first interval state

{number} nN

The last interval state

{BezierEase} ease optional

The interval easing

{Interval} target optional

The target instance

Returns

{Interval}

#constructor(t0, tDelta, n0, nDelta, ease)50-76

Creates a new instance

Signature

{undefined} Interval#constructor({number} t0, {number} tDelta, {number} n0, {number} nDelta, {BezierEase} ease)

Arguments

{number} t0

The first interval offset

{number} tDelta

The interval duration

{number} n0

The first interval state

{number} nDelta

The interval magnitude

{BezierEase} ease

The interval easing

Returns

No return value

#t055-55

The first interval state

Signature

{number} Interval#t0

#tDelta60-60

The interval duration

Signature

{number} Interval#tDelta

#n065-65

The first interval state

Signature

{number} Interval#n0

#nDelta70-70

The interval magnitude

Signature

{number} Interval#nDelta

#ease75-75

The interval easing

Signature

{BezierEase} Interval#ease

#define(t0, tDelta, n0, nDelta, ease)88-92

Redefines the instance

Signature

{Interval} Interval#define({number} t0, {number} tDelta, {number} n0, {number} nDelta, {BezierEase} ease)

Arguments

{number} t0

The first interval offset

{number} tDelta

The interval duration

{number} n0

The first interval state

{number} nDelta

The interval magnitude

{BezierEase} ease

The interval easing

Returns

{Interval}

#tN99-101

The last interval offset

Signature

{number} Interval#tN

#nN112-114

The last interval state

Signature

{number} Interval#nN

#fOfT(t)126-128

Returns the unclamped interval duration fraction

Signature

{number} Interval#fOfT({number} t)

Arguments

{number} t

The time

Returns

{number}

#nOfT(t)135-141

Returns the clamped interval state

Signature

{number} Interval#nOfT({number} t)

Arguments

{number} t

The time

Returns

{number}

#nOfF(f)148-150

Returns the unclamped interval state

Signature

{number} Interval#nOfF({number} f)

Arguments

{number} f

The interval duration fraction

Returns

{number}

#toString(digits)158-168

Returns a string representation of the instance

Signature

{string} Interval#toString([{int} digits=3])

Arguments

{int} digits optionaldefault3

The representation digits

Returns

{string}