Options
All
• Public
• Public/Protected
• All

# Class Shaping

Shaping provides various shaping/easing functions to interpolate a value non-linearly.

• Shaping

## Methods

### Static bounceIn

• bounceIn(t: number, c?: number): number
• Bounce in, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static bounceInOut

• bounceInOut(t: number, c?: number): number
• Bounce in-out, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static bounceOut

• bounceOut(t: number, c?: number): number
• Bounce out, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static circularIn

• circularIn(t: number, c?: number): number
• Circular in, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static circularInOut

• circularInOut(t: number, c?: number): number
• Circular in-out, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static circularOut

• circularOut(t: number, c?: number): number
• Circular out, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static cliff

• cliff(t: number, c?: number, p?: number): number
• Step function is a simple jump from 0 to 1 at a specific Pt in time

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

parma

p usually a value between 0 to 1, which specify the Pt to "jump". Default is 0.5 which is in the middle.

### Static cosineApprox

• cosineApprox(t: number, c?: number): number
• A faster way to approximate cosine ease in-out using Blinn-Wyvill Approximation. Adapated from Golan Levin's polynomial shaping

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static cubicBezier

• cubicBezier(t: number, c?: number, p1?: PtLike, p2?: PtLike): number
• Cubic bezier curve. This reuses the bezier functions in Curve class.

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

parma

p1`a Pt object specifying the first control Pt. Default is`Pt(0.1, 0.7).

parma

p2`a Pt object specifying the second control Pt. Default is`Pt(0.9, 0.2).

### Static cubicIn

• cubicIn(t: number, c?: number): number
• Cubic in, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static cubicInOut

• cubicInOut(t: number, c?: number): number
• Cubic in-out, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static cubicOut

• cubicOut(t: number, c?: number): number
• Cubic out, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static elasticIn

• elasticIn(t: number, c?: number, p?: number): number
• Elastic in, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

parma

p elastic parmeter between 0 to 1. The lower the number, the more elastic it will be. Default is 0.7.

### Static elasticInOut

• elasticInOut(t: number, c?: number, p?: number): number
• Elastic in-out, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

parma

p elastic parmeter between 0 to 1. The lower the number, the more elastic it will be. Default is 0.6.

### Static elasticOut

• elasticOut(t: number, c?: number, p?: number): number
• Elastic out, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

parma

p elastic parmeter between 0 to 1. The lower the number, the more elastic it will be. Default is 0.7.

### Static exponentialIn

• exponentialIn(t: number, c?: number, p?: number): number
• Exponential ease In, adapted from Golan Levin's polynomial shapers

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

parma

p a value between 0 to 1 to control the curve. Default is 0.25.

### Static exponentialOut

• exponentialOut(t: number, c?: number, p?: number): number
• Exponential ease out, adapted from Golan Levin's polynomial shapers

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

parma

p a value between 0 to 1 to control the curve. Default is 0.25.

### Static linear

• linear(t: number, c?: number): number
• Linear mapping

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static logSigmoid

• logSigmoid(t: number, c?: number, p?: number): number
• The Logistic Sigmoid is a useful curve. Adapted from Golan Levin's shaping function

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

parma

p a parameter between 0 to 1 to control the steepness of the curve. Higher is steeper. Default is 0.7.

### Static quadraticBezier

• quadraticBezier(t: number, c?: number, p?: number | PtLike): number
• Quadratic bezier curve. Adapted from Golan Levin's shaping functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

parma

p1 a Pt object specifying the first control Pt, or a value specifying the control Pt's x position (its y position will default to 0.5). Default is `Pt(0.95, 0.95)

### Static quadraticIn

• quadraticIn(t: number, c?: number): number
• Quadratic in, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static quadraticInOut

• quadraticInOut(t: number, c?: number): number
• Quadratic in-out, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static quadraticOut

• quadraticOut(t: number, c?: number): number
• Quadratic out, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static quadraticTarget

• quadraticTarget(t: number, c?: number, p1?: PtLike): number
• Give a Pt, draw a quadratic curve that will pass through that Pt as closely as possible. Adapted from Golan Levin's shaping functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

parma

p1`a Pt object specifying the Pt to pass through. Default is`Pt(0.2, 0.35)

### Static seat

• seat(t: number, c?: number, p?: number): number
• An exponential seat curve. Adapted from Golan Levin's shaping functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

parma

p a parameter between 0 to 1 to control the steepness of the curve. Higher is steeper. Default is 0.5.

### Static sigmoid

• sigmoid(t: number, c?: number, p?: number): number
• Sigmoid curve changes its shape adapted from the input value, but always returns a value between 0 to 1.

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

parma

p the larger the value, the "steeper" the curve will be. Default is 10.

### Static sineIn

• sineIn(t: number, c?: number): number
• Sinuous in, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static sineInOut

• sineInOut(t: number, c?: number): number
• Sinuous in-out, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static sineOut

• sineOut(t: number, c?: number): number
• Sinuous out, adapted from Robert Penner's easing functions

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

### Static step

• step(fn: Function, steps: number, t: number, c: number, ...args: any[]): any
• Convert any shaping functions into a series of steps

parma

fn the original shaping function

parma

steps the number of steps

parma

t a value between 0 to 1

parma

c the value to shape, default is 1

parma

args optional paramters to pass to original function

#### Returns any

Generated using TypeDoc