distancesToMesh | R Documentation |
Computes the distances from given points to a mesh.
distancesToMesh(mesh, points)
mesh |
a mesh given either as a list containing (at least) the fields
|
points |
either one point given as a numeric vector or several points given as a numeric matrix with three columns |
A numeric vector providing the distances between the given point(s) to the mesh.
# cube example #### library(MeshesOperations) mesh <- rgl::cube3d() points <- rbind( c(0, 0, 0), c(1, 1, 1) ) distancesToMesh(mesh, points) # should be 1 and 0 # cyclide example #### library(MeshesOperations) a <- 100; c <- 30; mu <- 80 mesh <- cyclideMesh(a, c, mu, nu = 100L, nv = 100L) O2 <- c(c, 0, 0) # should be a - mu = 20 (see ?cyclideMesh): distancesToMesh(mesh, O2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.