Description Usage Arguments Value Author(s) See Also Examples
View source: R/animatoR-functions-knitr.R
Change segment defining positions and plot subsequent segments. Lines are "floating" to final positions.
1 2 |
x0, x1 |
numeric vectors, start segments defining x coordinates. |
y0, y1 |
numeric vector, start segments defining y coordinates. |
x2, x3 |
numeric vector, end segments defining x coordinates. |
y2, y3 |
numeric vector, end segments defining 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. |
fixed |
numeric, which location is fixed:
start (0, default) - draw from |
... |
additional arguments passed to |
Numerical matrix with columns defining the current segments.
Andrej Blejec andrej.blejec@nib.si
segments
, dsegments
for drawing segments and tarrows
for moving arrows.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | x0 <- c(0,4,7)
y0 <- c(0,7,0)
x1 <- c(4,0,7)
y1 <- c(2,7,5)
x2 <- x0+1
y2 <- y0+2
x3 <- x1+1
y3 <- y1+2
newplot()
arrows(x0,y0,x2,y2,lty=2)
arrows(x1,y1,x3,y3,lty=2)
segments(x0,y0,x1,y1,col=2)
pos <- tsegments(x0,y0,x1,y1,x2,y2,x3,y3,0.75,lwd=3)
segments(x2,y2,x3,y3,col=4)
pos
points(pos$start)
points(pos$end)
d <- 0.2
points(x0-d,y0+d,pch="0")
points(x1+d,y1+d,pch="1")
points(x2-d,y2+d,pch="2")
points(x3+d,y3+d,pch="3")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.