VoronoiOnSphere | R Documentation |
Computes a spherical Voronoï tessellation.
VoronoiOnSphere(vertices, radius = 1, center = c(0, 0, 0), iterations = 5L)
vertices |
vertices, a numeric matrix with three columns |
radius |
radius of the sphere, a positive number; the vertices will be projected on this sphere |
center |
center of the sphere, a numeric vector of length three; the vertices will be projected on this sphere |
iterations |
positive integer, the number of iterations used to construct the meshes of the spherical faces |
First the Delaunay triangulation is computed, then the Voronoï tessellation is obtained by duality.
An unnamed list whose each element corresponds to a Voronoï face and is a named list with three fields:
site
, the coordinates of the Voronoï site of the face;
cell
, a numeric matrix providing the coordinates of the
vertices of the face;
mesh
, a mesh of the face used for plotting in the function
plotVoronoiOnSphere
.
plotVoronoiOnSphere
library(sphereTessellation)
library(rgl)
if(require(cooltools)) {
vertices <- fibonaccisphere(150L)
vor <- VoronoiOnSphere(vertices)
open3d(windowRect = 50 + c(0, 0, 512, 512), zoom = 0.8)
plotVoronoiOnSphere(vor, colors = "random")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.