Function [a, N] = polygon3darea(v)
[a, N] = polygon3darea(v,isclosed)
returns the area of the 3d polygon described
by its points.
The function also returns the unit normal of
the polygon. Note that the normal is calculated
from the first three points given by v; no further
checks on the validity of the normal are done!
It is not checked either whether all points are
on the same plane.
Matrix v lists the points of the polygon in the
right ordre. The first, second and third columns
contain x-, y- and z-coordinates.
The ordre of the points must follow the rule:
counter-clockwise direction as seen from a point
away from the plane in the direction of the normal.
If the first point listed in v is the last
point, the second argument isclosed must be input
and set to true or to the string "closed".
Reference:
"Area of triangles and polygons"
http://geomalgorithms.com/a01-_area.html
by 2000 softSurfer, 2012 Dan Sunday
retrieved on 2017-03-02
(c) 2026 fabien van mook
2026.08.20 release of this file within package "fvm-geometry" under GNU GPLv3+