Area of a triangle

15 ビュー (過去 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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by