NOT ENOUGH INPUT ARGUMENTS
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
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
Réponses (1)
Star Strider
le 5 Août 2017
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
Cette question est clôturée.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!