function [Length] = CalculateLength(hi,ii,hp,ip)

Ni = length(hi);
Np = length(hp);

count = 1;
for i = 1:Ni
    ii_1 = ii(i);
    hi_1 = hi(i);
    for p = 1:Np
        ip_1 = ip(p);
        hp_1 = hp(p);
        Length(count,1) = sqrt(((ii_1-ip_1)^2) + ((hi_1-hp_1)^2));
        count = count + 1;
    end
end
    