Compute a homothetic transformation for a set of points. The transformed set of points is optionally drawn as a polygon.
homothety(x, y, lambda, xcen = NULL, ycen = NULL, add = FALSE, ...)
x | the x coordinates of points. It can also be a matrix (see details). |
---|---|
y | the y coordinates of points. |
lambda | the factor to be used for the homothetetic transformations. |
xcen | the x coordinate for the center of rotation. |
ycen | the y coordinate for the center of rotation. |
add | logical. If |
... | additional arguments to be passed to |
If x
is a matrix with more than 2 columns, then x
is the first column and y the second one.
Note that lambda
, xcen
and ycen
are unique, meaning that homothety
computes only one homothetic transformation.
Drawing the points computed is relevant only if there are more than 2 points.
https://en.wikipedia.org/wiki/Homothetic_transformation.
poly3 <- homothety(x, y, -2.5, xcen=5, ycen=4, border=4, add=TRUE)