Area of a triangle

34 次查看(过去 30 天)
Luffy
Luffy 2012-6-14
移动DGM 2023-2-21
Is there a function to find area of triangle,not by using Heron's algorithm.

采纳的回答

Dr. Seis
Dr. Seis 2012-6-14
How about polyarea?
>> x = [0, 0, 4];
>> y = [0, 3, 0];
>> area1 = polyarea(x,y)
area1 =
6
>> area2 = 0.5*3*4
area2 =
6
  5 个评论
Dr. Seis
Dr. Seis 2012-6-22
I think you would have to do some sort of coordinate transform (to still use the "polyarea" function above), such that all the coordinate values for one of the dimensions (e.g., the z-coordinate) are 0. But it seems using Heron's algorithm would be much easier.
SaN AruL
SaN AruL 2016-11-25
移动:DGM 2023-2-21
thank you Dr. Seis..........

请先登录,再进行评论。

更多回答(1 个)

AYUSH MISHRA
AYUSH MISHRA 2020-5-26
function area=tri_area(b,h,n)
area=0.5*b*h*n;
end
%Here b=base of triangle , h=height of triangle , n=number of triangle
Example
area= tri_area(2,3,5)
area =
15

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by