Rotation(spdep)
Rotation()所属R语言包:spdep
Rotate a set of point by a certain angle
旋转一个特定的角度的一组点
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Rotate a set of XY coordinates by an angle (in radians)
XY坐标的一组旋转的角度(以弧度为单位)的
用法----------Usage----------
Rotation(xy, angle)
参数----------Arguments----------
参数:xy
A 2-columns matrix or data frame containing a set of X and Y coordinates.
A 2列的矩阵或含有一组X和Y坐标的数据框。
参数:angle
Numeric. A scalar giving the angle at which the points should be rotated. The angle is in radians.
数字。一个标点应该是在哪个角度旋转。的角度为弧度。
值----------Value----------
A 2-columns matrix of the same size as xy giving the rotated coordinates.
A 2列的矩阵的大小相同xy给予旋转坐标。
(作者)----------Author(s)----------
F. Guillaume Blanchet
实例----------Examples----------
set.seed(1)
### Create a set of coordinates[##创建一组坐标]
coords<-cbind(runif(20),runif(20))
### Create a series of angles[##创建一系列的角度]
rad<-seq(0,pi,l=20)
opar <- par(mfrow=c(5,4))
for(i in rad){
coords.rot<-Rotation(coords,i)
plot(coords.rot)
}
par(opar)
### Rotate the coordinates by an angle of 90 degrees[##旋转90度的角度的坐标]
coords.90<-Rotation(coords,90*pi/180)
coords.90
plot(coords,xlim=range(rbind(coords.90,coords)[,1]),ylim=range(rbind(coords.90,coords)[,2]),asp=1)
points(coords.90,pch=19)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|