i am using this code (Mr. David), How to measure volume of whole cone. Please guide. Regards in advance.
Coords= load('Bruno_Cone_20000_points.txt')x = Coords(:,1);y = Coords(:,2);z = Coords(:,3); % move to origin
x = x-mean(x);y = y-mean(y);z = z-mean(z); % convert to spherical system
[t,p,r] = cart2sph(x,y,z);tri = delaunay(t,p);trisurf(tri,x,y,z) % indices of triangle
i1 = tri(:,1);i2 = tri(:,2);i3 = tri(:,3); % vectors of triangle base
v1 = [x(i1)-x(i2) y(i1)-y(i2) z(i1)-z(i2)];v2 = [x(i1)-x(i3) y(i1)-y(i3) z(i1)-z(i3)];A = 1/2*cross(v1,v2,2); % surface of a triangle
V = 1/3*dot(A,[x(i1) y(i1) z(i1)],2); % volume of a triangle
format longV = sum(abs(V))
Best Answer