How to modify loop
이전 댓글 표시
I'm attempting to modify code to loop
댓글 수: 1
답변 (1개)
Roger Stafford
2017년 9월 8일
There is no single matlab function that will calculate it, but you can
make use of the geometrical theorem that the radius of a circumscribing
circle of a triangle is equal to the product of its three sides divided by
four times the triangle's area.
a = sqrt((x1-x2)^2+(y1-y2)^2); % The three sides
b = sqrt((x2-x3)^2+(y2-y3)^2);
c = sqrt((x3-x1)^2+(y3-y1)^2);
s = (a+b+c)/2;
A = sqrt(s*(s-a)*(s-b)*(s-c)); % Area of triangle
R = a*b*c/(4*A); % Radius of circumscribing circle
카테고리
도움말 센터 및 File Exchange에서 Neighborhood and Block Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!