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

답변 (1개)

Star Strider
Star Strider 2017년 8월 5일

1 개 추천

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

이 질문은 마감되었습니다.

태그

질문:

2017년 8월 5일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by