min_dist.mesh | R Documentation |
Compute distance between a point and a mesh
min_dist.mesh(p, mesh, norm = rep(1, ncol(mesh$p)))
p |
point to compute distance from |
mesh |
mesh to compute distance to |
norm |
vector of weights for each dimension (default: 1) |
distance between x and mesh
x = matrix(0,ncol=2)
m = list(p = matrix(c(0,1,1,0,1,1),ncol=2,byrow=TRUE), tri = matrix(c(1,2,3),nrow=1))
plot2d_mesh(m)
points(x)
min = min_dist.mesh(x,m)
lines(rbind(x,attr(min,"proj")),col='red')
m = mesh_exsets(function(x) (0.25+x[1])^2+(0.5+x[2]/2)^2, vec=FALSE,
1 ,1, intervals=rbind(cbind(0,0),cbind(1,1)), num_workers=1)
plot2d_mesh(m)
x = matrix(c(0.25,0.25),ncol=2)
points(x)
min = min_dist.mesh(x,m)
lines(rbind(x,attr(min,"proj")),col='red')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.