帮助中心帮助中心
多边形的面积
a = polyarea(x,y)
a = polyarea(x,y,dim)
示例
a = polyarea(x,y) 返回向量 x 和 y 中的顶点定义的二维多边形的面积。
x
y
如果 x 和 y 是相同长度的向量,则 polyarea 返回 x 和 y 定义的多边形的标量面积。
polyarea
如果 x 和 y 是相同大小的矩阵,则 polyarea 返回行向量,该行向量包含 x 和 y 中的列向对组定义的每个多边形的面积。
如果 x 和 y 是多维数组,则 polyarea 沿第一个长度不等于 1 的维度进行运算。
a = polyarea(x,y,dim) 沿维度 dim 运算。
dim
全部折叠
创建一组点,它们定义了一个二维多边形。
p = linspace(0,2.*pi,9); x = 1.2*cos(p)'; y = 1.2*sin(p)';
绘制多边形。
plot(x,y); axis equal
计算多边形的面积。
a = 4.0729
x 坐标,指定为向量、矩阵或多维数组。
y 坐标,指定为向量、矩阵或多维数组。
沿其运算的维度,指定为正整数标量。
polyarea 返回的面积值可能与输入点的顺序有关。
backgroundPool
ThreadPool
此函数完全支持基于线程的环境。有关详细信息,请参阅在基于线程的环境中运行 MATLAB 函数。
此函数完全支持 GPU 数组。有关详细信息,请参阅Run MATLAB Functions on a GPU (Parallel Computing Toolbox)。
此函数完全支持分布式数组。有关详细信息,请参阅Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox)。
在 R2006a 之前推出
nsidedpoly | polyshape | inpolygon | rectint
nsidedpoly
polyshape
inpolygon
rectint
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office