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!