ellipsePoints(sfsmisc)
ellipsePoints()所属R语言包:sfsmisc
Compute Radially Equispaced Points on Ellipse
计算径向均布点于椭圆形
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Compute points on (the boundary of) an ellipse which is given by elementary geometric parameters.
计算点(边界)的椭圆形,其中由下式给出基本的几何参数。
用法----------Usage----------
ellipsePoints(a, b, alpha = 0, loc = c(0, 0), n = 201, keep.ab.order=FALSE)
参数----------Arguments----------
参数:a,b
length of half axes in (x,y) direction. Note that (a,b) is equivalent to (b,a) unless keep.ab.order=TRUE.
半轴的长度(的x,y)中的方向。注意,(a,b)是相当于(b,a)除非keep.ab.order=TRUE。
参数:alpha
angle (in degrees) giving the orientation of the ellipse, i.e., the original (x,y)-axis ellipse is rotated by angle.
给人的方向的椭圆形,即,原来的(的x,y)轴椭圆的角度(单位:度)是旋转angle。
参数:loc
center (LOCation) of the ellipse.
椭圆形的中心(位置)。
参数:n
number of points to generate.
数目的点来生成。
参数:keep.ab.order
logical indicating if (a,b) should be considered ordered. When FALSE, as per default, the orientation of the ellipse is solely determined by alpha. Note that keep.ab.order = TRUE seems a more natural default, but FALSE is there for back-compatibility.
逻辑如果(a,b)应考虑订购。当FALSE,根据默认的,椭圆形的方向是完全确定的alpha。请注意,keep.ab.order = TRUE似乎更天然默认,但FALSE是用于向后兼容性。
值----------Value----------
A numeric matrix of dimension n x 2, each row containing the (x,y) coordinates of a point.
一个数字矩阵的维n x 2,每行包含(X,Y)的点的坐标。
(作者)----------Author(s)----------
Martin Maechler, March 2002.
参见----------See Also----------
the "ellipse" package and ellipsoidhull and ellipsoidPoints in the "cluster" package.
ellipse包和ellipsoidhull和ellipsoidPointscluster包。
实例----------Examples----------
## Simple Ellipse, centered at (0,0), x-/y- axis parallel:[#简单的椭圆形,中心在(0,0),x-/y-轴平行:]
ep <- ellipsePoints(5,2)
str(ep)
plot(ep, type="n",asp=1) ; polygon(ep, col = 2)
## (a,b) = (2,5) is equivalent to (5,2) :[#(,)=(2,5)是相当于(5,2):]
lines(ellipsePoints(2,5), lwd=2, lty=3)
## keep.order=TRUE : Now, (2,5) are axes in x- respective y- direction:[#keep.order = TRUE:现在,(2,5)的X各自的y方向上的轴:]
lines(ellipsePoints(2,5, keep.ab.order=TRUE), col="blue")
## rotate by 30 degrees :[#旋转30度:]
plot(ellipsePoints(5,2, alpha = 30), asp=1)
abline(h=0,v=0,col="gray")
abline(a=0,b= tan( 30 *pi/180), col=2, lty = 2)
abline(a=0,b= tan(120 *pi/180), col=3, lty = 2)
## NB: use x11(type = "Xlib") for the following if you can[#注:如果你能使用X11(类型=“Xlib的”)以下]
if(dev.interactive()) {
## Movie : rotating ellipse :[#电影:旋转的椭圆形:]
nTurns <- 4 # #{full 360 deg turns}[#{完整的360度转弯}]
for(al in 1 nTurns*360)) {
ep <- ellipsePoints(3,6, alpha=al, loc = c(5,2))
plot(ep,type="l",xlim=c(-1,11),ylim=c(-4,8),
asp=1, axes = FALSE, xlab="", ylab="")
}
## Movie : rotating _filled_ ellipse {less nice to look at}[#电影:旋转_filled_椭圆{在}不太好看]
for(al in 1:180) {
ep <- ellipsePoints(3,6, alpha=al, loc = c(5,2))
plot(ep,type="n",xlim=c(-1,11),ylim=c(-4,8),
asp=1, axes = FALSE, xlab="", ylab="")
polygon(ep,col=2,border=3,lwd=2.5)
}
}# only if interactive[只有互动]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|