计算一组点的凸包,即面积最小的覆盖多边形。
参考文献
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.
参见
其他: running_mean()
, sample_seq()
作者
Tamas Nepusz ntamas@gmail.com
示例
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
#>