Dear all,
I have several sets of x-y-z points and I need to estimate the volume that
encompass all my points.
Recently I got some adivice to show the "convex hull" of my points
using
geometry package (see code below).
But now I need to calculate the volume of my set of points.
Any advice are wellcome.
Thanks in advance
Miltinho Astronauta
Brazil
-----
require(geometry)
library(rgl)
x<-rnorm(100)
k<-runif(100)*20+5
y<-rnorm(100)
z<-sin(x)+cos(y)^2
my.data.3d<-data.frame(cbind(x,y,z))
my.data.3d = sqrt(3) * my.data.3d / drop(sqrt((my.data.3d^2) %*% rep(1,3)))
data.ts.surf = t( convhulln(my.data.3d,"QJ") ) # see the qhull
documentations for the options
## Not run:
rgl.triangles(my.data.3d[data.ts.surf,1],my.data.3d[data.ts.surf,2],my.data.3d[data.ts.surf,3],col="blue",alpha=.2)
for(i in 1:(8*360)) rgl.viewpoint(i/8)
[[alternative HTML version deleted]]