Compute a translation for a set of points. The transformed set of points is optionally add to the current plot.
translation(x, y, xtrans = 0, ytrans = 0, add = FALSE, ...)
x, y | x and y coordinates of points to be translated (can also be a matrix, see details). |
---|---|
xtrans | the x coordinate of the translation vector. |
ytrans | the y coordinate of the translation vector. |
add | logical. If |
... | Additional arguments to be passed to |
For details about what is a translation, see
https://en.wikipedia.org/wiki/Translation_(geometry). Note that if x
is a
matrix with more than 2 columns, then x is the first column and y the second
one.
trans1 <- translation(x,y,xtrans=2,ytrans=5, add=TRUE, border=4, lwd=2)