필터 지우기
필터 지우기

Area of a triangle

조회 수: 18 (최근 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에서 Cartesian Coordinate System Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by