tpoints: Move points

Description Usage Arguments Value Author(s) See Also Examples

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

Description

Move points from start to end location

Usage

1
2
tpoints(x0, y0, x1 = x0, y1 = y0, t, when = c(0, 1), p = 1,
  trace = FALSE, trace.col = "grey", ...)

Arguments

x0

numeric vector, start x coordinates.

y0

numeric vector, start y coordinates.

x1

numeric vector, end x coordinates.

y1

numeric vector, end y coordinates.

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.

trace

logical. Should movement leave a trace?

trace.col

color of the trace.

...

additional arguments passed to points.

Value

List with numerical components x and y with current position.

Author(s)

Andrej Blejec andrej.blejec@nib.si

See Also

points

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x0 <- c(0,5)
y0 <- c(0,5)
x1 <- c(1,10)
y1 <- c(1,10)
print(tpoints(x0,y0,x1,y1,0.5))
#############
par(mfrow=c(2,2))
for( t in seq(0,1,1/3)) {
newplot()
tpoints(x0,y0,x1,y1,t,trace=TRUE)
}

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