rotatexy(shape)
rotatexy()所属R语言包:shape
rotates 2-column matrix around a midpoint
围绕中点旋转2列的矩阵
译者:生物统计家园网 机器人LoveR
描述----------Description----------
rotates xy values around a midpoint; xy is either a 2-columned matrix or a 2-valued vector
围绕中点旋转xy值; xy是2列的矩阵或2值的矢量
用法----------Usage----------
rotatexy(xy, angle, mid = colMeans(xy), asp = FALSE)
参数----------Arguments----------
参数:xy
matrix with 2 columns, or a 2-valued vector to be rotated.
与2列,或2 - 值向量旋转矩阵。
参数:angle
angle of rotation, in degrees.
的旋转角度,单位为度。
参数:mid
rotation point, default=centroid.
旋转点,默认的重心。
参数:asp
if true: aspect ratio is kept.
如果为true:保持纵横比。
值----------Value----------
a 2-column matrix with rotated values
2列的矩阵旋转值
(作者)----------Author(s)----------
Karline Soetaert <karline.soetaert@nioz.nl>
实例----------Examples----------
x <- seq(0, 2*pi, pi/100)
y <- sin(x)
cols <- intpalette(c("blue", "green", "yellow", "red"), n = 500)
cols <- c(cols,rev(cols))
plot(x, y, type = "l", ylim = c(-3, 3), main = "rotatexy",
col = cols[1], lwd = 2)
for (i in 2:1000)
lines(rotatexy( cbind(x, y), angle = 0.18*i),
col = cols[i], lwd = 2)
cols <- femmecol(1000)
plot(x, y, xlim = c(-1, 1), ylim = c(-1, 1), main = "rotatexy",
col = cols[1], type = "n")
for (i in 2:1000) {
xy <- rotatexy(c(0, 1), angle = 0.36*i, mid = c(0,0))
points(xy[1], xy[2], col = cols[i], pch = ".", cex = 2)
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|