Description Usage Arguments Value Author(s) See Also Examples
View source: R/animatoR-functions-knitr.R
Draw arrows from start to end location. The effect is like starting from a point and draw an arrow on the screen.
1 |
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. |
length |
length of the edges of the arrow head (in inches). |
... |
additional arguments passed to |
List with numerical components x
and y
with
current position.
Andrej Blejec andrej.blejec@nib.si
arrows
, tarrows
for moving arrows and dsegments
for drawing segments.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | x0 <- c(0,5,10)
y0 <- c(0,10,0)
x1 <- c(10,5,0)
y1 <- c(10,0,10)
newplot()
pos <- darrows(x0,y0,x1,y1,0.25)
points(pos)
points(x0,y0,pch="0")
points(x1,y1,pch="1")
#############
if(interactive()){
par(mfrow=c(2,2))
for( t in seq(0,1,1/3)) {
newplot()
darrows(x0,y0,x1,y1,t)
points(x0,y0,pch="0")
points(x1,y1,pch="1")
}
}
#############
if(interactive()){
par(mfrow=c(2,2))
for( t in seq(0,1,1/3)) {
newplot()
darrows(x1,y1,x0,y0,t)
points(x0,y0,pch="0")
points(x1,y1,pch="1")
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.