This functions extracts polygons from a voronoi.mosaic object.

voronoi.polygons(voronoi.obj)

Arguments

voronoi.obj

object of class voronoi.mosaic

Value

Returns an object of class voronoi.polygons with unamed list elements for each polygon. These list elements are matrices with columns x and y. Unbounded polygons along the border are represented by NULL instead of a matrix.

Author

Denis White

Examples

data(franke)
fd3 <- franke$ds3
fd3.vm <- voronoi.mosaic(fd3$x,fd3$y)
fd3.vp <- voronoi.polygons(fd3.vm)
fd3.vp
#> [[1]]
#> NULL
#> 
#> [[2]]
#> NULL
#> 
#> [[3]]
#>              x         y
#> [1,] 0.6682398 0.9830357
#> [2,] 0.6035850 0.6813135
#> [3,] 0.6167763 0.6562500
#> [4,] 0.9000000 0.6562500
#> [5,] 0.9531250 0.7500000
#> [6,] 0.6791952 0.9934931
#> 
#> [[4]]
#>              x         y
#> [1,] 0.3128205 0.6910256
#> [2,] 0.3752941 0.7691177
#> [3,] 0.3886013 0.8800110
#> [4,] 0.2987903 0.9810484
#> [5,] 0.0781250 0.8406250
#> [6,] 0.1187500 0.7187500
#> 
#> [[5]]
#> NULL
#> 
#> [[6]]
#>              x         y
#> [1,] 0.6035850 0.6813135
#> [2,] 0.3752941 0.7691177
#> [3,] 0.3128205 0.6910256
#> [4,] 0.3404944 0.5637259
#> [5,] 0.3725291 0.5335756
#> [6,] 0.5826389 0.5635912
#> [7,] 0.6167763 0.6562500
#> 
#> [[7]]
#> NULL
#> 
#> [[8]]
#> NULL
#> 
#> [[9]]
#> NULL
#> 
#> [[10]]
#>              x         y
#> [1,] 0.3752941 0.7691177
#> [2,] 0.6035850 0.6813135
#> [3,] 0.6682398 0.9830357
#> [4,] 0.3886013 0.8800110
#> 
#> [[11]]
#> NULL
#> 
#> [[12]]
#>              x         y
#> [1,] 0.1187500 0.7187500
#> [2,] 0.0102500 0.5792500
#> [3,] 0.1120494 0.4304663
#> [4,] 0.3404944 0.5637259
#> [5,] 0.3128205 0.6910256
#> 
#> [[13]]
#>              x         y
#> [1,] 0.6167763 0.6562500
#> [2,] 0.5826389 0.5635912
#> [3,] 0.6356013 0.4349684
#> [4,] 0.7291284 0.4300459
#> [5,] 0.9000000 0.6388889
#> [6,] 0.9000000 0.6562500
#> 
#> [[14]]
#>              x         y
#> [1,] 1.0045455 0.4181818
#> [2,] 0.9000000 0.6388889
#> [3,] 0.7291284 0.4300459
#> [4,] 0.8264881 0.3132143
#> [5,] 0.8738032 0.3061170
#> 
#> [[15]]
#>              x         y
#> [1,] 0.5702206 0.3477941
#> [2,] 0.5792553 0.2574468
#> [3,] 0.6904167 0.1907500
#> [4,] 0.8264881 0.3132143
#> [5,] 0.7291284 0.4300459
#> [6,] 0.6356013 0.4349684
#> 
#> [[16]]
#>              x         y
#> [1,] 0.3165782 0.2978041
#> [2,] 0.3951563 0.3978125
#> [3,] 0.3725291 0.5335756
#> [4,] 0.3404944 0.5637259
#> [5,] 0.1120494 0.4304663
#> [6,] 0.1129343 0.4074585
#> 
#> [[17]]
#>              x         y
#> [1,] 0.5792553 0.2574468
#> [2,] 0.5702206 0.3477941
#> [3,] 0.3951563 0.3978125
#> [4,] 0.3165782 0.2978041
#> [5,] 0.3330357 0.1250000
#> [6,] 0.4227273 0.1250000
#> 
#> [[18]]
#>              x           y
#> [1,] 0.9600145  0.09058864
#> [2,] 0.8738032  0.30611703
#> [3,] 0.8264881  0.31321427
#> [4,] 0.6904167  0.19075000
#> [5,] 0.7689203 -0.09186314
#> 
#> [[19]]
#>              x           y
#> [1,] 0.3330357  0.12500000
#> [2,] 0.3001786  0.09625000
#> [3,] 0.2493325 -0.02239078
#> [4,] 0.4706865 -7.10571671
#> [5,] 0.7460724 -0.14859968
#> [6,] 0.4227273  0.12500000
#> 
#> [[20]]
#>              x          y
#> [1,] 1.0045455 0.41818181
#> [2,] 1.7035956 0.20542741
#> [3,] 0.9600145 0.09058864
#> [4,] 0.8738032 0.30611703
#> 
#> [[21]]
#>              x         y
#> [1,] 0.3725291 0.5335756
#> [2,] 0.3951563 0.3978125
#> [3,] 0.5702206 0.3477941
#> [4,] 0.6356013 0.4349684
#> [5,] 0.5826389 0.5635912
#> 
#> [[22]]
#>               x         y
#> [1,] 0.11293429 0.4074585
#> [2,] 0.01971154 0.2598558
#> [3,] 0.30017856 0.0962500
#> [4,] 0.33303571 0.1250000
#> [5,] 0.31657818 0.2978041
#> 
#> [[23]]
#>              x           y
#> [1,] 0.5792553  0.25744680
#> [2,] 0.6904167  0.19075000
#> [3,] 0.7689203 -0.09186314
#> [4,] 0.7460724 -0.14859968
#> [5,] 0.4227273  0.12500000
#> 
#> [[24]]
#> NULL
#> 
#> [[25]]
#>                x           y
#> [1,]  0.01971154  0.25985578
#> [2,] -0.24226190  0.12886904
#> [3,]  0.24933252 -0.02239078
#> [4,]  0.30017856  0.09625000
#> 
#> attr(,"class")
#> [1] "voronoi.polygons"