getMinCircle(shotGroups)
getMinCircle()所属R语言包:shotGroups
Minimum enclosing circle for a set of 2D-points
一组二维点的最小封闭圆的
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Calculates center and radius of the minimum enclosing circle given a set of 2D-coordinates.
计算给出了一组二维坐标的最小封闭圆的圆心和半径。
用法----------Usage----------
getMinCircle(xy)
参数----------Arguments----------
参数:xy
a numerical (n x 2)-matrix with the (x,y)-coordinates of n >= 2 points (1 row of coordinates per point).
数值(为nx 2)矩阵的(x,y)的坐标的n> = 2分(1行的每点的坐标)。
Details
详细信息----------Details----------
Uses the Skyum algorithm based on the convex hull.
使用的Skyum的算法的基础上的凸包。
值----------Value----------
A list containing the center and radius of the circle.
一个列表,其中包含的圆心和半径的圆。
参数:ctr
a numerical 2-vector giving the (x,y)-coordinates of the circle's center.
的数值的2矢量得到的(x,y)的坐标的圆的中心。
参数:rad
a numerical value giving the radius of the circle.
给人的圆的半径的数值。
参见----------See Also----------
drawCircle, getMinBBox, getBoundingBox
drawCircle,getMinBBox,getBoundingBox
实例----------Examples----------
xy <- matrix(round(rnorm(20, 100, 15), 2), ncol=2)
mc <- getMinCircle(xy)
# determine axis limits so that circle will be visible[确定轴的限制,使圈将是可见的]
xLims <- mc$ctr[1] + c(-mc$rad, mc$rad)
yLims <- mc$ctr[2] + c(-mc$rad, mc$rad)
plot(xy, pch=16, asp=1, xlim=xLims, ylim=yLims)
drawCircle(mc$ctr[1], mc$ctr[2], mc$rad, fg='blue')
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|