seq_ease: Create a sequence interpolating between two values with the...

View source: R/easings.R

seq_easeR Documentation

Create a sequence interpolating between two values with the specified non-linear easing.

Description

Create a sequence interpolating between two values with the specified non-linear easing.

Usage

seq_ease(x1 = 0, x2 = 1, n = 100, type = "cubic", direction = "in-out")

Arguments

x1, x2

The start and end values of the sequence. Default: 0, 1

n

Number of steps for the transition (including the endpoints)

type

Type of motion easing. Default: 'cubic'. Valid values are are 'sine', 'quad', 'cubic', 'quart', 'quint', 'exp', 'circle', 'back', 'elastic', 'linear'.

direction

When should the easing apply? Default: "in-out". Valid values are 'in', 'out', in-out'. Default: 'in-out'

Value

Numeric vector of length n

Examples

x <- seq_ease(x1 = 0, x2 = 1, n = 20, type = 'cubic', direction = 'in-out')
x
plot(x)

coolbutuseless/displease documentation built on Dec. 17, 2024, 10:07 p.m.