h: Homotopy Function

Description Usage Arguments Value Note Author(s) Examples

View source: R/animatoR-functions-knitr.R

Description

Interpolates a position between start and end value(s). Homotopy is controled by a homotopy parameter t and power parameter p is used for interpolation.

Usage

1
h(x0, x1, t = 0, when, p = 1)

Arguments

x0

numeric vector of start values.

x1

numeric vector of end values.

t

numeric, homotopy parameter, limited between 0 and 1. This parameter can be considered as fraction of animation duration time.

when

numeric vector. This parameter controls the times of: entrance, exit, start of movement and, end of movement.

p

numeric, homotopy power parameter. Defaults to 1.

Value

interpolated value (see Note)

Note

Returned coordinates are determined using the homotopy function

x_t=x_0 (1-t^p)+x_1 t^p, t\in[0,1]

Author(s)

Andrej Blejec andrej.blejec@nib.si

Examples

1
2
3
4
h(1, 2, 0)
h(1, 2, 1)
h(1, 2, .5)
h(1,c(2,3),.5)

ablejec/animatoR documentation built on Feb. 21, 2020, 10:09 p.m.