%-----------------------------------------------------------
% Carlos Cabral 2003 - Dep.UA

% calculo do comprimento das rectas ( deve ser 500 mm por 200 mm ) 
%-----------------------------------------------------------   

function [segm1_compr, segm2_compr]=COMPRI_SEGM(cart_data, segmento, indexofconsider, k5)

    deltax=cart_data(segmento(indexofconsider(k5),1),1)-cart_data(segmento(indexofconsider(k5),2),1);
    deltay=cart_data(segmento(indexofconsider(k5),1),2)-cart_data(segmento(indexofconsider(k5),2),2);
    segm1_compr=sqrt(deltax^2+deltay^2);
    
    deltax=cart_data(segmento(indexofconsider(k5)+1,1),1)-cart_data(segmento(indexofconsider(k5)+1,2),1);
    deltay=cart_data(segmento(indexofconsider(k5)+1,1),2)-cart_data(segmento(indexofconsider(k5)+1,2),2);
    segm2_compr=sqrt(deltax^2+deltay^2);