.. highlightlang:: us .. _polyarea: polyarea ======== .. index:: polyarea .. us.tag polyarea ENGLISH New331 :ref:`polyarea` returns the area of a simple polygon specified by the vertices in the vectors X and Y. .. function:: rsA = polyarea(rvX, rvX) .. us.return **Return Value** *rsA* is the area. .. us.params **Parameters** .. uparam:: rvX *rvX* is a real vector. .. uparam:: rvY *rvY* is a real vector. .. us.comment **Comment** The area is a postive value. The polygon will be closed if the last vertex (xN,yN) is not the same as the first vertex. The only restriction that will be placed on the polygon for this function to work is that the polygon must not be self intersecting. Note for polygons with holes. The holes are usually defined by ordering the vertices of the enclosing polygon in the opposite direction to those of the holes. .. us.example **Example** :: xx = linspace(0, 2.0*PI, 6); x = cos(xx); y = sin(xx); A = polyarea(x, y); rvH = plot(xv,yv); Createtitle("Area = " + strtod(A)) .. seealso:: :ref:`overview-mathematic` :sub:`id-726682`