NOT ENOUGH INPUT ARGUMENTS
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
this is my problem incentro1 Error using incentro1 (line 2) Not enough input arguments.
function [I,r]=incentro1 (A,B,C)
Ax=A(1);
Ay=A(2);
Bx=B(1);
By=B(2);
Cx=C(1);
Cy=C(2);
bc=sqrt((Bx-Cx)^2+(By-Cy)^2);
ac=sqrt((Ax-Cx)^2+(Ay-Cy)^2);
ab=sqrt((Ax-Bx)^2+(Ay-By)^2);
if bc<ac+ab && ac<bc+ab && ab<bc+ac
Ix=(Ax*bc+Bx*ac+Cx*ab)/(bc+ac+ab);
Iy=(Ay*bc+By*ac+Cy*ab)/(bc+ac+ab);
I=[Ix,Iy];
s=(bc+ac+ab)/2;
r=sqrt(((s-bc)*(s-ac)*(s-ab))/s);
display(I)
display(r)
else
disp('Los puntos no forman un triángulo');
end
0 个评论
回答(1 个)
Star Strider
2017-8-5
It works correctly for me when I give it the correct arguments:
A = [1 2];
B = [2 3];
C = [3 1];
[I,r]=incentro1 (A,B,C)
I =
1.8604e+000 2.1396e+000
r =
509.6537e-003
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!