跳到内容

计算一组点的凸包,即面积最小的覆盖多边形。

用法

convex_hull(data)

参数

data

数据点,一个两列的数值矩阵。

一个具有以下组件的命名列表

resverts

构成凸包的输入顶点的索引。

rescoords

凸包的角坐标。

参考文献

Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, Second Edition. MIT Press and McGraw-Hill, 2001. ISBN 0262032937. Pages 949-955 of section 33.3: Finding the convex hull.

参见

作者

Tamas Nepusz ntamas@gmail.com

convex_hull().

示例


M <- cbind(runif(100), runif(100))
convex_hull(M)
#> $resverts
#>  [1] 10 38 27 88 72 84 90 73 16 19 81 46
#> 
#> $rescoords
#>              [,1]        [,2]
#>  [1,] 0.235531409 0.001072066
#>  [2,] 0.126216803 0.019510332
#>  [3,] 0.089983823 0.108878658
#>  [4,] 0.014145369 0.403278272
#>  [5,] 0.004698588 0.672168630
#>  [6,] 0.006506867 0.880128023
#>  [7,] 0.399955332 0.970398800
#>  [8,] 0.932846401 0.981499094
#>  [9,] 0.957504642 0.795799484
#> [10,] 0.979656620 0.571665475
#> [11,] 0.986170822 0.387042148
#> [12,] 0.999093372 0.019301232
#>