Find 3D Polygon Area

Given the nx3 matrix, which represents n points in three-dimensional space. All points lie on the plane. A plane is determined by its normal and by a point lying on it. Is there a Matlab function or any Matlabby way to search for an area directly from a matrix?

What I was trying to do was write a function that first calculates centroid, c, n-gon. Then we form triangles: (1,2, c), (2,3, c), ..., (n, 1, c). Calculate their area and summarize. But then I had to arrange the polygon points in a cyclic order, because they were disordered, which, as I understood it, were difficult. Is there an easy way to do this?

Is there an easier way in Matlab to just call some function on a matrix?

+4
source share
3 answers

Here is perhaps an easier way. First, suppose your plane is not parallel to the z axis. Then project the polygon down onto the xy plane, simply by deleting the third coordinate. Now calculate the area A 'in the xy plane by conventional methods .

If your plane makes the angle & theta; with xy-plane, then your 3D area A = A '/ cos ?.

If your plane is parallel to the z axis, do the same wrt calculation instead, the y axis protruding onto the xz plane.

+4
source

3D , N, A - U = N x A V = N x U. U V, P.U P.V .

( ).

+2

, , . 2-D . Matlab, , Math.SE Matlab Central .

If you have already solved the problem of finding the coordinates of points in the two-dimensional plane in which they are located, you can use the Matlab boundary or convex function to calculate the area of ​​the boundary or convex hull covering the points.

[k,v]= boundary(x,y)

or

[k,v] =convhull(x,y)

where k is the vector of indices at the points x, y that define the boundary or convex hull, v is the area enclosed in the hull, and x, y are the x and y coordinate vectors of your points.

What you described when trying to find triangles with dots is like the first attempt at Delaunay triangulation. I think later versions of Matlab also have Delaunay triangulation features.

+1
source

All Articles